0

I am using the following command to print the last column using the delimiter ','. However one of my output is not printed appropriately as the last column is a string which has multiple commas. How can we ignore the comma in the string and print whole column .

awk -F',' '{print $(NF)}' file.csv | tail +2

Input

1.1.1.1,{'opt':2},"Mozilla,chrome,safari"

Expected Output

"Mozilla,chrome,safari"

Current Output

safari

  • 1
    Did you try searching or `[awk] csv extra commas`? 23 Q/A returned. You'll probably find your answer there. In any case my advise would be to use an alternate field seperator (one that won't be found in the data) . Good luck. – shellter Jan 16 '23 at 15:34

0 Answers0