View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph
 
Posts: n/a
Default How to save text as CSV which also contains commas?

"V.R." wrote in message
...
"David Biddulph" wrote:

"V.R." wrote in message
...
How can I save a data file in CSV format when one of the fields
contains
commas?


By default, Excel will include double quotes round the contents of such
field, and when importing the csv file it will treat the double quotes as
text delimiters. Save it as CSV, then look at the CSV file with
something
like Notepad.


Thanks David.
Opening the file in notepad looks fine.
But, what about if I want to see the data as an excel sheet. Extra commas
in
a field shows me extra column. Isn't there a way to avoid this?


It shouldn't show you the extra column when it reimports. It doesn't for
me.
It might be worth trying renaming the file as a txt rather than csv, then if
you open the file from within Excel you'll hopefully get the wizard & will
be able to ensure that you've got the delimiter set as comma and the text
qualifier as a double quote.

In a recent thread, one contributor was having problems because the double
quote wasn't immediately after the comma (so it was necessary to get rid of
the extraneous spaces before reimporting), or if there were double quotes
within the text field, but in general it should be OK.
--
David Biddulph