The leading zeros in the zip code are not displaying in Excel when I open the CSV file. What's going on?

The leading zeros in the zip code are actually there in the CSV file. When you open the CSV with a text application like notepad or wordpad, you'll see them there.

However, if the zip code only contains numbers, Excel and other spreadsheet applications will auto-detect the data type as a number and will automatically remove the leading zeros when you open the CSV file directly with Excel.

To have them display correctly in Excel, you'll need to use Excel's Text Import Wizard.

1. Start Excel with a blank workbook open.

2. Select 'Data' on the ribbon, and then 'From Text'. (If the menu options are greyed out this could be because you do not have a workbook open).

3. Browse for the *.csv file you want to open, and click 'Import'.

4. In the Text import wizard, ensure the 'Delimited' option is selected. Click Next.

5. In the delimiters section, tick 'Comma'. The text qualifier box should show the double-quote symbol. Click Next.

6. Mark every column as 'Text'. The first column only will initially be highlighted. Move the horizontal cursor as far as it will go to the right; then, holding the shift key down, click the very last column heading. You should now have every column highlighted. Click the 'Text' data format. It will now say 'Text' in the header of every column. Click Finish.

7. It may ask you 'Where do you want to put the data?'. It will allow you to click into any cell on the blank worksheet to determine where the data should go. Click 'OK' to proceed.

8. The data should now appear in the spreadsheet. Where column headings are included these will appear in the top row. Check that fields have not lost leading zeros where applicable.

Source

Another alternative is by simply adding an apostrophe at the beginning of the data so Excel will auto-detect the data type as text. You can do this in EZ Exporter by adding a Custom Field like this:

'{{ shipping_address.zip }}

Update: EZ Exporter now supports exporting to Excel (.xls, .xlsx) formats directly which will automatically set the zip code column as text data.


Related Articles:


App: EZ Exporter

Tags: faq, csv, excel