Best way to search only in a specific field of a tab separated file #1959
-
I'm looking for the best way to search only in field no. 4 of a tab separated text file (no tabs or newlines inside a field). The best way I have found is: The regular expression looks a bit weird but seems to work properly. Field no. 4 is the fourth field (counting from 1) so {3} has to be used (number of the wished field minus one). "search_string" is searched at any position in field no. 4. I could use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You could also use |
Beta Was this translation helpful? Give feedback.
You could also use
cut
. Otherwise, looks pretty good to me.