leading zeros fall off in csv format.

  • Thread starter Thread starter susanmarie
  • Start date Start date
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 .
 
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
 
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.
 
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.
 
Back
Top