Replace comma with tab everywhere except enclosed in a pair of double quotes.

sed -e ‘:a;s/^\(\(“[^”]*”\|[^”,]*\)*\),/\1\t/;ta’ Apl.txt > Test.txt

Advertisements