![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2008
Posts: 3
Rep Power: 0
![]() |
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 ![]() |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Aug 2008
Posts: 3
Rep Power: 0
![]() |
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 } |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Putting spaces between formatted text fields | Fall Back Son | Java | 7 | Feb 12th, 2008 9:40 PM |
| text files auto imported into fields | Micskill | HTML / XHTML / CSS | 1 | Nov 26th, 2007 10:24 PM |
| using Text fields in SWT | elford | Java | 4 | Dec 27th, 2005 1:38 PM |
| Resizing fields to match text | Arla | C# | 3 | Aug 4th, 2005 2:56 PM |