Excel removing leading leading zeros when displaying CSV data

Posted by Velika Kudac on Super User See other posts from Super User or by Velika Kudac
Published on 2012-06-01T22:30:00Z Indexed on 2012/06/01 22:43 UTC
Read the original article Hit count: 292

Filed under:
|

I have a CSV text file with the following content:

"Col1","Col2"
"01",A
"2",B
"10", C

When I open it up with Excel, it displays as shown here:

Note that Cell 2A attempts to display "01" as a number without a leading 0.

enter image description here

When I format rows 2 through 4 as "Text", it changes the display to

enter image description here

...but still the leading "0" is gone.

Is there a way to open up a CSV file in XLS and be able to see all of the leading zeros in the file by flipping some option? I do not want to have to retype '01 in every cell that should have a leading zero. Furthermore, using a leading apostrophe necessitates that the changes be saved to a XLS format when CSV is desired. My goal is simply to use Excel to view the actual content of the file as text without Excel trying to do me any formatting favors.

© Super User or respective owner

Related posts about microsoft-excel

Related posts about excel-2003