Retaining leading zeros with a CSV file

G

Guest

Please help
I am using Microsoft Office Exel 2003. If I recall in previous version, if I put a single quote mark in the first position of a cell, followed by number that had leading zeros, it would save the leading zeros (and not keep the single quote mark as data). This does not seem to be working for me now

Can you tell me how to retain leading zeros in a cells value when saving as a CSV file

All help is greatly appreciated

Thank
 
G

Guest

Not sure about CSV but before entering the numbers change
the format of the cells to text. This will save the
leading zeros.
-----Original Message-----
Please help!
I am using Microsoft Office Exel 2003. If I recall in
previous version, if I put a single quote mark in the
first position of a cell, followed by number that had
leading zeros, it would save the leading zeros (and not
keep the single quote mark as data). This does not seem
to be working for me now.
Can you tell me how to retain leading zeros in a cells
value when saving as a CSV file?
 
G

Guest

Thanks. Unfortunately, when you save as a csv file, no
formatting is retained. I discovered if I save it as a
csv file (using the leading single quote and leading
zeros), I can view it with wordpad (or dos) and the
leading zeros are retained (without the leading single
quote mark saved as data). But if I open it in excel
again, it removes the leading zeros. Maybe some guru will
see this and explain what is going here.

Thanks for taking the time to post a reply!
 
D

Dave Peterson

After you save your data in the .CSV file, open that file up in Notepad (or your
favorite text editor).

I bet you'll see the leading 0's.

But if you re-import that .csv file back into excel, you'll lose the leading
0's. Excel sees numbers as numbers and 000001 and 1 are equal.

If you want to re-import into excel and keep the format, you could rename the
..csv to .txt and then you'll see the text to columns wizard and you can specify
text (and keep the leading 0's).

Or you could let it come in as numbers and give it a nice format later.
 
G

Guest

Thanks! I kept playing with it and what I found confirms
what you state here. Thank you SO MUCH for taking the
time to reply. I really appreciate it!
-----Original Message-----
After you save your data in the .CSV file, open that file up in Notepad (or your
favorite text editor).

I bet you'll see the leading 0's.

But if you re-import that .csv file back into excel, you'll lose the leading
0's. Excel sees numbers as numbers and 000001 and 1 are equal.

If you want to re-import into excel and keep the format, you could rename the
..csv to .txt and then you'll see the text to columns wizard and you can specify
text (and keep the leading 0's).

Or you could let it come in as numbers and give it a nice format later.
previous version, if I put a single quote mark in the
first position of a cell, followed by number that had
leading zeros, it would save the leading zeros (and not
keep the single quote mark as data). This does not seem
to be working for me now.
 
S

Steve Guenther

I use Excel 2002. I don;t know if this works in 2003, but it does in 2002.

If you want your numbers to show leading zeroes for up to 10 digits, format
your cell with a custom format.

From the toolbar select Format, then Cells, then in the Format Cells window
pick the Custom category, and go over to the Type box and enter ten zeroes
and click OK. If your number in that cell is 35, you will see 0000000035.
 

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