![]() |
Remove commas from text fields in .csv
This must have been done a million times but I can't seem to find the solution :(
I have a "normal" comma-separated file (.csv) with some text fields in double-quotes. These fields MAY contain a comma, which should be changed to a space. I want to use sed or awk (or gawk) to zap the unwanted commas, leaving the legit delimiting commas intact. Any help appreciated ... TA :?: |
Re: Remove commas from text fields in .csv
Just to add - Problem solved (with the help of some genii !) The following worked for me:
gawk -F\" -v OFS=\" -f awkscr.txt Infile > Outfile with awkscr.txt containing: { for (i=2; i<=NF; i+=2) { gsub(","," ",$i) }; print } |
| All times are GMT -5. The time now is 12:01 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC