Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving as a CSV and losing leading Zeros

Status
Not open for further replies.

bluearmy35

Technical User
May 25, 2004
66
GB
I wonder if anyone can help me with this problem, i have an excel spreadsheet that has a column with a series of numbers that have 6 numbers in each cell, now when i save this excel spreadsheet as a CSV it removes all the leading zero's therefore if something was in Excel as 000001 it comes over as 1. Is there anyway to get it into a CSV as what it was originally. Any help would be much appreciated
 
You could try preceedind each value with a single quote
Excel should then see it as text

Damian.
 
If you just want to recover your original format, you can open the csv file with notepad. To bring it into an xls format, you could then
1. Open a blank xls sheet and format all cells to Text (Format-Cells-Number Tab-Category=Text.
2. replace the commas with tabs in notepad (Since you can't type a tab in the Find and Replace window, you can press tab in the worksheet and cut it out (ctrl-X), and Paste that into the replace box)
3. paste into Excel.
I'm sure that there are more elegant ways to do this but it's a start.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top