Losing leading 0 when saving as .csv

  • Thread starter Thread starter Mark Christensen
  • Start date Start date
M

Mark Christensen

Hello,

I've got Excel 2002. I've got an address file that I need to save as a .csv
file. In the file are ZIP codes that begin with 0. These leading 0's are
being dropped when I save as a .csv file. Here's what I've tried so far to
keep the leading 0's in .csv:

1) In the .xls file, selected the ZIP column (column G) and formated the
cells as Text. Then saved as .xls and then saved as .csv. When I then open
the .csv file, the leading 0's are missing. If I open the .xls file, the
leading 0's are intact.
2) After opening the .csv file created in step 1, I again select the ZIP
column (G) and format the cells from General to Text. I then manually add
the missing 0 to the affected rows and save as .csv. I then close the .csv
and reopen it and the leading 0's are missing. I reselect the column to
check the formatting of the cells. The column has reverted back to General
even though I changed it to Text.

What am I doing wrong?

More importantly, how do I keep the leading 0's in the .csv file?

Thanks.

Mark
 
I just did some more googling and discovered the missing 0's are in fact
present in the .csv file - they just aren't showing when I open the .csv
file in Excel. I opened it in Notepad and the leading 0's were there, so I
guess chalk this one up to operator error! Thanks.

Mark
 
I just did some more googling and discovered the missing 0's are in fact
present in the .csv file - they just aren't showing when I open the .csv
file in Excel. I opened it in Notepad and the leading 0's were there, so I
guess chalk this one up to operator error! Thanks.

Chalk it up to formatting :) You cleverly saved the data as text, but when
XL reopened it, it saw only numbers and assumed they were ? You can tell it
that your data is text IIRC.

Good news anyway :)
 
Back
Top