View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph
 
Posts: n/a
Default Saving a CSV file from Excel with 0 in front of Zip code

"ChuckW" wrote in message
...
Dave,

When I open it in notepad the zeros are there. When I save it as a text
file
though they dissapear. I am saving it as a text file but it looks like an
Excel/CSV file rather than the notepad icon. Does this help?


So if when you open it in Notepad the zeroes are there, the problem isn't
with Excel writing the CSV file, it is with the program that you are later
using to read the CSV file.

What do you mean about "saving it as a text file"? CSV already *is* a text
file (as you've seen in Notepad). You can change its extension to anything
else (such as TXT) if you wish to do so. If you are reading the CSV into
Excel and then using that to save as TXT, then of course you'll lose the
leading zeroes. [If you did want to read such a CSV into Excel without
losing the data, change the extension to TXT and read it in with the wizard,
ensuring that you select text as the format for the relevant columns at the
final stage.]
--
David Biddulph