I have a document (.txt) composed like that.
info1: info2: info3: info4
And I want to show some information by column. For example, I have some different information in “info3” shield, I want to see only the lines who are composed by “test” in “info3” column.
I think I have to use sort but I’m not sure. Any idea ?
Advertisement
Answer
You can use awk
for this. Assuming your columns are de-limited by :
and column 3 has entries having test
, below command lists only those lines having that value.
awk -F':' '$3=="test"' input-file