leading zeros fall off in csv format.

S

susanmarie

leading zeros fall off in csv format. I need to know if this is normal or if
I need to make a change to formatting or some other option .
 
J

JP

Can you be more specific, i.e.

1. Are the zeros being dropped when you enter them and then leave the
cell? or,
2. Are the zeros being dropped when you (re)open the file or import it
in Excel or in another program?


Thx,
JP
 
G

Gary''s Student

The leading zeros are dropped when the .csv file is opened, not when it is
created. You can verify this by openning the .csv with NotePad.

To preserve the leading zeros, don't open the .csv by double-click. Just
open Excel and:

Data > Import External Data... > Import Data and select the .csv from the
dialog.

The Import Wizard will allow you to specfy Text rather than General and thus
save the leading zeros.
 
D

David Biddulph

Have you looked at the CSV with Notepad to see whether the leading zeroes
really have fallen off?

My guess is that they were there in the CSV, but that someone has tried to
open the file with Excel, and Excel has assumed on the import that they are
numbers and thus lost the leading zeroes at that stage. If you do want to
read a CSV in Excel, don't use File/ Open or double-click the CSV, but
instead in Excel use Data/ Import External Data ... then you'll get the Text
import wizard which will allow you to specify the column format as Text.
 

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