csv file drops zeros at beginning of a set of Numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have programs that only import the csv format. When I create the file with
a text field using number such as 0101, 0321 if I close and reopen the file
it drops the zero. How do I correct this?
 
Lisa

Three ways

1) If all the 'numbers' are the same length (4 characters) then via
Format>Cells...Number>Custom, type 0000
2) Pre-format the cells to text and it will retain the leading zeroes.
3) rename the file with no extension or a *.txt one and then when you open
it Excel will invoke the import wizard, choose delimited, comma and then in
the third stage of the wizard, mark the offending column(s) as text

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
Lisa,

It probably isn't dropping the zeroes when it writes the csv file, but when
you reopen it with Excel. Go to www.smokeylake.com/excel. Go to "Very
Frequently Asked Questions (VFAQ)" and look at "TEXT FILE -- SAVING -- DATA
GETS CHANGED."
 

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

Back
Top