Change Delimiter

222 views
Skip to first unread message

Alan Jones

unread,
Jun 21, 2013, 11:38:39 AM6/21/13
to csv...@googlegroups.com
I was reading the docs and did not see this.  Is there a way to take a CSV file and change the delimiter from a comma ","  to a | (pipe) or some other value?  However only do that for true delimiters and not values inside quotes?


any thoughts or new feature?







Neil Butterworth

unread,
Jun 21, 2013, 11:51:48 AM6/21/13
to csv...@googlegroups.com
This is described in the "Commands" section of the manual. You need to use the -sep, -rsep and -osep options, depending on what exactly you want to do.

Alan Jones

unread,
Jun 26, 2013, 11:35:56 AM6/26/13
to csv...@googlegroups.com
Thanks for the response.....

In playing with CSVfix I am running into issues around using flags without any commands.

csvfix echo -sep | myfile.csv  > test1.csv
csvfix echo -sep "|" myfile.csv > test1.csv

my output is not putting the pipe "|" in place of the comma (no quotes).

I was not sure if i had to use the echo command if i could use the -o flag  but was not sure if the syntax was working. 

I am also going to add the -smq (that part worked).

I wish there was a flag for -keepq or something to keep quoting the same as the original file.

thanks for you help.

Neil Butterworth

unread,
Jun 26, 2013, 11:48:58 AM6/26/13
to csv...@googlegroups.com
-sep specifies the input separator - you need to use -osep to specify the output separator


> I wish there was a flag for -keepq or something to keep quoting the same as the original file.

Not possible, given the current CSVfix architecture, I'm afraid.

Alan Jones

unread,
Jun 27, 2013, 10:05:18 AM6/27/13
to csv...@googlegroups.com
thanks for the response.  I figured out the -osep about 5 minutes after I made my posts.  I wanted to reach out and grab but could not.

I am a little confused on the difference of -rsep and it's use.

I had to thing of -sep the "Separator used for input files" then i realized the -osep for output more how the name suggests.

I might be nice if you could adjsut the manual for the -sep descriptoin to say "set the separator used for input file"

I am sorry to hear the current architecture does not keeping the original quoting structure in place.  We can work around it but seems nice to sometimes respect the current structure if needed.

I do want to say I truly appreciate such a good program.  I work at a nonprofit organization (NGO) and we are trying to incorporate CSVFix into some other work to make life easier and code cleaner.

thanks again for your help!!

Alan
Reply all
Reply to author
Forward
0 new messages