Follow

How to ensure the leading zeros stay on a CSV file

The purpose of this article is to show the process on how to ensure the leading zeroes stay on a CSV file.

 

  1. Click on Save to my computer as
  2. Select either CSV or CSV (with options)
  3. Click Save -- DO NOT OPEN THE CSV FILE DIRECTLY WITH EXCEL!
  4. Open a new worksheet in Excel (see below for Excel screenshots.)
  5. Open the Data tab
  6. Click on the From text button in the Get External Data section
  7. Select your CSV file to import
  8. Select the "Delimited" radio button -- Text Import Wizard, Step 1 determines that your data is delimited
  9. Click Next
  10. Check "Comma" as a delimiter (column dividers will appear in preview)-- Step 2 lets you set delimiters
  11. Click Next
  12. Highlight the column(s) with leading zeros in Step 3
  13. Mark those columns format as "text" by clicking the radio button in the Column Data Format section.  NOTE: You will need to do this for each column where the data contains leading zeros.
  14. Click Finish
  15. The leading zeros will still be there in the new worksheet with the imported data. The columns with real numbers will still be able to be used with calculations.

Please Note: The file doesn't have to be a CSV file. It can be a text file as well. If it is a text file, in step 10 use "TAB" as the column finder, not "comma".

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.