In my temp.txt
tab delimited temp.txt
it looks like this
field1 field2 field3 field4 field5 field6
field1 field2 field3 field4 field5 field6 field7
field1 field2 field3 field4 field5 field6 field7 field 8
According to your update, I highly recommend using cut
:
cut -f6- temp.txt
prints field 6 to the end of the line.
Note -d
indicates the delimiter, but the tab is the default delimiter. You can do this in awk
, but I find cut
easier.
With awk
it will look like this:
awk '{print substr($0, index($0, $6))}' temp.txt
if my temp.txt tab delimited file looks like this
field1 field2 field3 field4 field5 field6
field1 field2 field3 field4 field5 field6 field7
field1 field2 field3 field4 field5 field6 field7 field 8
awk -F"\t" '{print $6}' temp.txt
will only print the 6th box. if the separator is a tab, it will most likely work without setting -F, but I like to set my field separator when I can.
in the same way it will also shrink.
cut -f6 temp.txt
I have a suspicion that your question is a little more complicated, so if you answer my comment, I can try to expand my answer. Strike>
source share