I want to print all lines from a CSV file that match the character string "ac"
. So if column 2 equals "ac"
, then print this line.
Before
"id","make","model","yeear","product"
"11","ac","tot","1999","9iuh8b"
"12","acute","huu","1991","soyo"
"13","ac","auu","1992","shjoyo"
"14","bb","ayu","2222","jkqweh"
"15","bb","ac","8238","smiley"
After
"11","ac","tot","1999","9iuh8b"
"13","ac","auu","1992","shjoyo"
I attempted cat file| grep "ac"
, but this will give me all lines that have ac
:
"11","ac","tot","1999","9iuh8b"
"12","acute","huu","1991","soyo"
"13","ac","auu","1992","shjoyo"
"15","bb","ac","8238","smiley"