I have a file which looks like:>TCONS_00000066_1     [3    -   170]>TCONS_00000066_2     [174  -   206]>TCONS_00000066_3     [2    -   223]>TCONS_00000066_4     [210  -   281]>TCONS_00000066_5     [227  -   316]>TCONS_00000066_6     [1    -   324]>TCONS_00000066_7     [285  -   338]>TCONS_00000066_8     [335  -   373]>TCONS_00000066_9     [342  -   377]>TCONS_00000066_10    [328  -   465]>TCONS_00000066_11    [377  -   487]>TCONS_00000066_12    [469  -   546]>TCONS_00000066_13    [390  -   551]>TCONS_00000066_14    [518  -   556]>TCONS_00000066_15    [537  -   490]>TCONS_00006042_1     [9    -   62]>TCONS_00006042_2     [87   -   146]>TCONS_00006042_3     [150  -   203]>TCONS_00006042_4     [2    -   220]>TCONS_00006042_5     [1    -   255]The file is tab delimited. I want to remove just the _1 and _2....after every >TCONS_0000****. The rest of all the columns will be there as is.Like: >TCONS_00000066    [3    -   170]>TCONS_00000066    [174  -   206]>TCONS_00000066    [2    -   223]>TCONS_00000066    [210  -   281]>TCONS_00000066    [227  -   316]>TCONS_00000066    [1    -   324]>TCONS_00000066    [285  -   338]>TCONS_00000066    [335  -   373]Note: every >TCONS_*contains 8digits, like >TCONS_00000066..., >TCONS_00987652
Replace string in the first column
text processing
This should work for youcat file.txt | sed 's/\([0-9]\)_[0-9]\+\t/\1\t/'Search for a digit (named as \1) followed by an underscore followed by one or more digits followed by a tab and replace with named \1 and a tab