-1

I've a file named xyz.csv which are comma separated.I'm trying to get the output where the 2nd column should have value "01", 50th column as "ABC" and the content of 80th column using nawk?

User123
  • 1,498
  • 2
  • 12
  • 26
  • The goal is that you add some code of your own to show at least the research effort you made to solve this yourself. – Cyrus Nov 04 '17 at 17:45

1 Answers1

1

Could you please try following and let me know if this helps.

nawk -F"," '$2=="01" && $50 == "ABC"{print $80}'  xyz.csv

OR

If you are looking for 50th and 80th field's value should be ABC and you want to print current line then following may help you in same.

nawk -F"," '$2=="01" && $50 == "ABC" && $80 == "ABC"'  xyz.csv
RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93