How to keep loaded file's format intact?

C

Claire

Hello,
I am loading into spreadsheet .csv file, where each field is
enclosed in quotation marks, and separated by the comma.
Each line looks like this:
"No name"," 1 555 2340553","2009-09-07 14:55:08","","No Dialtone. Line is
not connected or it is in use.","8"
That file loads nicely into spreadsheet, each field into its own cell.
However, when saving it, the format (quotation marks) is gone.
I need to preserve that quotations marks.
The reason for it is that some data may contain commas which are not field
separators, and the same file is being used also by another app.


That csv file was created by me using another app. I need to preserve commas
which are part of data.

What will be the best procedure in that case?
If Excel cannot save the file in the same format, then how should I prepare
the csv file?

Your help appreciated,
Claire
 
D

Dave Peterson

If you're just using File|SaveAs and saving as a .CSV file, then excel won't put
double quotes around all your fields. It doesn't think it needs to.

But you could save your data anyway you want. Maybe you could use a macro that
would save the data in the format you like.

Or even use a helper column of cells that concatenates the fields into the
strings you like:

=""""&A1&""","""&B1&""""
(and so forth)

You can use =char(34) to represent the double quote, too:
=char(34)&a1&char(34)&","&char(34)&b1&char(34)

And if you need special formatting:
=char(34)&a1&char(34)&","&char(34)&b1&char(34)&","
&char(34)&text(c1,"yyyy-mm-dd hh:mm:ss")&char(34) & .....

Then drag this formula down as far as you need.
Edit|Copy that column

Then start up NotePad (or your favorite text editor) and paste the data there
(just that single column).

And save NotePad as your .csv file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top