Solved

Saving excel file as a csv file

Posted on 2014-10-21
1
242 Views
Last Modified: 2014-10-21
Hello

I have to save an excel file as a csv file.  One of the columns has data which may begin with zero(s).  After the saving the file I notice the leading zero(s) are dropped.  When I save the file as a text this does not happen, but I need a csv file.

Thank you,
John
0
Comment
Question by:jverasql
1 Comment
 
LVL 1

Accepted Solution

by:
Josh Carpenter earned 500 total points
ID: 40395070
What's happening is that Excel is formatting the numbers as numbers (integers) and then removes the zeros from view. You can format those cells differently so that the zeroes are properly displayed: http://office.microsoft.com/en-us/excel-help/format-numbers-as-text-HP010342535.aspx

From their Tips on that page:

"When you enter a number that begins with a zero—for example, a product code—Excel will delete the zero by default. If this is not what you want, you can create a custom number format that forces Excel to retain the leading zero. For example, if you're typing or pasting ten-digit product codes in a worksheet, Excel will change numbers like 0784367998 to 784367998. In this case, you could create a custom number format consisting of the code 0000000000, which forces Excel to display all ten digits of the product code, including the leading zero. For more information about this issue, see Create or delete a custom number format and Keep leading zeros in number codes."
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This collection of functions covers all the normal rounding methods of just about any numeric value.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question