I\'m trying to parse a .csv file and I have some problems with IFS. The file contains lines like this:
\"Hello\",\"World\",\"this\",\"is, a boring\",\"line\" >
You may wish to use the gawk with FPAT to define what makes a valid string -
FPAT
Input :
"hello","world","this,is"
Script :
gawk -n 'BEGIN{FS=",";OFS="\n";FPAT="([^,]+)|(\"[^\"]+\")"}{$1=$1;print $0}' somefile.csv
Output :
"hello" "world" "this,is"