Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Losing leading 0 when saving as .csv

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Christensen - 09 Jul 2007 14:45 GMT
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
Mark Christensen - 09 Jul 2007 15:07 GMT
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

> Hello,
>
[quoted text clipped - 21 lines]
>
> Mark
Bruce Sinclair - 11 Jul 2007 00:20 GMT
>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 :)

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.