I have following data set in csv and would like to filter this on multiple columns using awk (My Version is GNU 3.1.7)
How can i use awk to filter on multiple columns
i used following command but didn't give required result.
awk -F, '{ if ($7="3YM62AE#UUS" && $5="01CS") print $1","$2","$3","$4","$5","$6","$7","$14}' file1.csv > file2.csv
Let me know if i am using correct awk command.
Could you please try following. Haven't tested it but you need to change from =
to ==
.
awk '
BEGIN{
FS=OFS=","
}
{
if($7=="\"3YM62AE#UUS\"" && $5=="\"01CS\""){
print $1,$2,$3,$4,$5,$6,$7,$14
}
}' file1.csv > file2.csv
You are cool dude , what exactly is this syntax if($7=="\"3YM62AE#UUS\"" && $5=="\"01CS\"")