Excel to CSV: Formatting Quote Marks

S

Stephen

We have an application we use (MAS 500) that imports CSV files. We use

Excel to create these files; however, since the last upgrade of our
application, we are now required to have the header in each CSV file
use the following format:

"@HDR","BATCH","20060127","Daily 1/27/2006",""
"@HDR","JOURNAL","","1"


The problem is getting the quotation marks right. It will look fine in

Excel, but no matter what I try, it won't give me the format above.
Instead, the CSV file will have either no quote marks or double quote
marks.


I know that doubling up on quote marks is part of Excel's process of
converting to CSV, and I understand why that is useful in most cases,
but in this case it is just the opposite.


Any suggestions?
 
D

Dave Peterson

I would think writing a macro to export the data exactly the way you want it
would be the way to go:

Some samples:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

Earl's program has a supports lots of different options. You may want to see if
that works for you right out of the box.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
B

Bill Sharpe

Stephen said:
We have an application we use (MAS 500) that imports CSV files. We use

Excel to create these files; however, since the last upgrade of our
application, we are now required to have the header in each CSV file
use the following format:

"@HDR","BATCH","20060127","Daily 1/27/2006",""
"@HDR","JOURNAL","","1"


The problem is getting the quotation marks right. It will look fine in

Excel, but no matter what I try, it won't give me the format above.
Instead, the CSV file will have either no quote marks or double quote
marks.


I know that doubling up on quote marks is part of Excel's process of
converting to CSV, and I understand why that is useful in most cases,
but in this case it is just the opposite.


Any suggestions?
How about editing the first two lines of the CSV file to replace double
quote marks with single quote marks?

Bill
 

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