Total Pageviews

2017/10/10

How do I Keep Leading Zeros in CSV Files?

Problem
I am using Java to write data into CSV file. 
One of the column in the CSV file is cell phone number.
If I open this CSV file by Microsoft Excel, the first digit will disappear.

Take the first record for example. The correct value is 0912123456, but it show 912123456 in Microsoft Excel.

How-To
When you write cell number into CSV file, you should write ="0912123456" instead of 0912123456.



No comments: