CSV wont save numbers as text

sdyckman

New Member
Joined
Aug 8, 2003
Messages
4
I need to save an excel file in csv format. The problem is that one of the colums contain numbers in the format of 09876. This colum is saved as "text" in excel. When I save as a CSV from excel it switches to "General" format. If I first save it as a text file then use the wizard to keep the colum as text, as soon as I save the file as CSV it returns to the general format and I lose the 0. 09876 becomes 9876. I need it to be 09876 and it has to be csv.

Thanks for your help,

Shain
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
In a blank worksheet I formatted cell A1 as Text and enter 09876. I saved the file as Temp.csv. When I opened it in Notepad I got 09876. So I can't reproduce your problem.
 
Upvote 0
I'm assuming you're dealing with zip codes here. We also require a .csv to import into our proprietary shipping system. We have found that if you don't open the .csv prior to importation, the leading zeroes will remain. But if you open the .csv to check it, they will disappear.
 
Upvote 0
To add to Chez Bubb'a answer, you could open the saved file in notepad and see the leading "0".

I suggest always using the Import Text Wizard when opening any text file in Excel. It guides you to define how the file should be parced and the data type of each field/column. From the drop down menu, click

Code:
Data/Get External Data/Import Text File

and follow the wizard. My experience is that its a lot easier to define it up front than "fix" it after opening. The above is not code, but drop down menu navigation.
 
Upvote 0
Thank you all for your suggestions. I will try to save it and "not check it." If the zeros are still there, the import will go through.

This is the first technical message board that I have received such a fast and numerous response. Thanks!

Shain
 
Upvote 0

Forum statistics

Threads
1,225,149
Messages
6,183,179
Members
453,151
Latest member
Lizamaison

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top