I have a file with content as shown below.
cat t2 :
100,100,"X",1234,"12A",,,"ab,c"
Comma is the field seperator, however string fields will be within double quotes and comma within double quotes should not be treated as field seperator.
I am trying to replace this field seperator to a distinct character like a pipe or \001 and then perform some analysis.
I have used below perl command which is working correctly, but has some problem with performance. My file has about 7 Million rows and this command is taking about 45 mins.
cat t2 | perl -M'Text::ParseWords' -ne 'print (join("\001" => quotewords(",",0, $_)))' | cat -v
100^A100^AX^A1234^A12A^A^A^Aab,c
Looking forward for some advise on making this script run faster or if there is alternate approach using unix commands like AWK or SED..