Dear All,
I have a data file input.csv like below. (Only five column shown here for example.)
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
3,2,4,5,6
5,3,5,5,6
From this I want the below output
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
where the second column StepNo contents are '1'.
I used the below simple script to get this output.
awk -F, '$2==1' input.csv
But many times the second column is not always StepNo as there are many versions of input files with varying column positions and total number of columns.
So I need a script(with awk) to get my required output by specifying column name instead of referring from column number .
Thanks in advance.
Sidda