View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default How do I output csv files from Excel with quotes round text fields

Excel likes to do what it wants. If it thinks you don't need the qualifier, it
won't put them in.

Maybe you could write your own exporting program that would behave exactly the
way you want:

Here are three sites that you could steal some code from:

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

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

(or maybe you could build your own formula that concatenates the cells using a
giant formula and copy|paste into Notepad.)

DickG wrote:

Example:
A1 = 123, B1 = XYZ, C1 = 0, D1 = THISISTEXT

Saving as csv will generate
123,XYZ,0,THISISTEXT

I want to output
123,"XYZ",0,"THISISTEXT"


--

Dave Peterson