Apr 13, 2005 #1 jinkys Programmer Sep 11, 2003 67 GB I have a .csv file in the following format 123,"abc",456,"def,ghi",789 Anyone know how I can change the delimeters in this from comma to pipe (|)? noting there is a comma within a text field.
I have a .csv file in the following format 123,"abc",456,"def,ghi",789 Anyone know how I can change the delimeters in this from comma to pipe (|)? noting there is a comma within a text field.
Apr 13, 2005 #2 PHV MIS Nov 8, 2002 53,708 FR A starting point: sed 's/\([0-9"]\),\([0-9"]\)/\1|\2/g' /path/to/input.csv > output Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
A starting point: sed 's/\([0-9"]\),\([0-9"]\)/\1|\2/g' /path/to/input.csv > output Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Apr 14, 2005 #3 tchatzi Technical User Dec 15, 2004 744 GR or simply Code: sed 's/,/|/g' old.csv > new ``The wise man doesn't give the right answers, he poses the right questions.'' TIMTOWTDI Upvote 0 Downvote
or simply Code: sed 's/,/|/g' old.csv > new ``The wise man doesn't give the right answers, he poses the right questions.'' TIMTOWTDI
Apr 14, 2005 Thread starter #4 jinkys Programmer Sep 11, 2003 67 GB thanks guys but I've decided to use the quotewords function in perl Upvote 0 Downvote
Apr 14, 2005 #5 PHV MIS Nov 8, 2002 53,708 FR perluserpengo, have you read the OP ? noting there is a comma within a text field Upvote 0 Downvote
Apr 14, 2005 #6 tchatzi Technical User Dec 15, 2004 744 GR Sorry dude i didn't see that. My appologies ``The wise man doesn't give the right answers, he poses the right questions.'' TIMTOWTDI Upvote 0 Downvote
Sorry dude i didn't see that. My appologies ``The wise man doesn't give the right answers, he poses the right questions.'' TIMTOWTDI