How can I save a data file in CSV format when one of the fields contains
commas?
How can I save a data file in CSV format when one of the fields contains
commas?
"V.R." <[email protected]> wrote in message
news:[email protected]...
> 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.
--
David Biddulph
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?
"David Biddulph" wrote:
> "V.R." <[email protected]> wrote in message
> news:[email protected]...
> > 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.
> --
> David Biddulph
>
>
>
"V.R." <[email protected]> wrote in message
news:[email protected]...
> "David Biddulph" wrote:
>
>> "V.R." <[email protected]> wrote in message
>> news:[email protected]...
>> > 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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks