Introduction
This is an Excel issue. The program automatically truncates all leading zeros from numbers in CSV files. The key is to change the columns where the leading zeros occur, into text. There are two options for accomplishing this.
Option 1
- Click on Save to my Computer as.
- Select either CSV or CSV with options.
- Click Save. DO NOT OPEN THE CSV FILE DIRECTLY IN EXCEL!
- Open a new worksheet in Excel.
- Click on the Data tab in the Navigation Bar.
- Click the From Text icon in the Get External Data section.
- Select your CSV file to import.
- Select the Delimited radio button. Text Import Wizard, Step 1 determines that your data is delimited.
- Click Next.
- Check Comma as a delimiter (column dividers will appear in preview). Step two lets you set delimiters.
- Click Next.
- Highlight the column(s) with leading zeros in Step three.
- Mark those columns formatted as Text by clicking the radio button in the Column Data Format section. YOU WILL NEED TO DO THIS FOR EACH COLUMN WHERE THE DATA CONTAINS LEADING ZEROS.
- Click Finish.
- The leading zeros will still be there in the new worksheet with the imported data. The columns with real numbers can still be used with calculations.
Option 2
- Click on Save to my Computer as.
- Select either CSV or CSV with options.
- Click Save. DO NOT OPEN THE CSV FILE DIRECTLY WITH EXCEL!
- Change the file extension from .csv to .txt.
- Open a new worksheet in Excel.
- Click the Data tab in the Navigation Bar.
- Click the From Text icon in the Get External Data section.
- Select your CSV file to import.
- Select the Delimited radio button. Text Import Wizard, Step 1 determines that your data is delimited.
- Click Next.
- Check Comma as a delimiter (column dividers will appear in preview). Step two lets you set delimiters.
- Click Next.
- Highlight the column(s) with leading zeros in Step three.
- Mark those columns formatted as Text by clicking the radio button in the Column Data Format section. YOU WILL NEED TO DO THIS FOR EACH COLUMN WHERE THE DATA CONTAINS LEADING ZEROS.
- Click Finish.
- The leading zeros will still be there in the new worksheet with the imported data. The columns with real numbers can still be used with calculations.