Losing leading 0 when saving as .csv

  • Thread starter Mark Christensen
  • 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
 
M

Mark Christensen

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
 
B

Bruce Sinclair

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 :)
 

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

Similar Threads

CSV Format 4
Text Output To CSV 5
Leading Zeros 2
Open CSV as txt data 5
Missing commas in csv save 2
CSV file dropping lead zeros 1
Display leading zeros 2
CSV & open by excel 7

Top