Leading zero in CSV files data October 24, 2012

Comma separated values files are used widely to create reports or export data from applications. It’s easy to generate such files and use them. You can use MS Excel or Open Office or Google Docs. Thought there is one issue can appear if you have numbers with leading zero which are important do not miss. For example, part numbers. If you open such CSV files in MS Excel it will convert numbers with leading zero to numbers and remove leading zero.

The solution will be to notify MS Excel to interpret data as string but not as number. You can do it in the following format:


So this number will be shown with leading zero as text but not as number:


Leave a Reply