FAQs

What is a CSV file?

A CSV file is a type of text file, which can be opened with a text editor such as Notepad, or Notepad++. If the user has Excel installed, CSV files will open in Excel instead.

You can see in Windows the difference between a normal Excel file and a CSV file:

Excel and CSV file types in Windows Explorer.

… and with file extensions shown:

Excel and CSV file types in Windows Explorer with extensions visible.

There is a difference in icons too:

Excel and CSV file icons in Windows Explorer.

While smaller, they are visible in Outlook as well:

Excel and CSV file icons in Microsoft Outlook.

CSV files store data in rows and columns, much like Excel does. It works by using commas to separate cells in a row (hence comma-delimited), and using a new line to mark the end of a row.

An example CSV file in Notepad.

The above will display in Excel as follows:

An example CSV file in Excel.

How do I change my Excel file to a CSV file?

This is easily done in Excel, by going to “File”, pressing “Save As”, then selecting “CSV (Comma delimited)” as the file type:

Save file options in Excel.

Do not select the following options:

  • CSV UTF-8 (Comma delimited) (*.csv)
  • CSV (Macintosh) (*.csv)
  • CSV (MS-DOS) (*.csv)

Why is my data mis-aligned?

There may be occasions when data saved as CSV doesn’t align to the columns as expected, for example:

Mis-aligned CSV data showing in Excel.

In this instance, this is due to the row 3 column 1 having a comma in it:

Mis-aligned CSV data showing in Notepad.

If a comma is required in a cell, such as if it’s part of an address, all data for that cell must be surrounded with double quotes:

Corrected CSV data showing in Notepad.

This will then display in Excel as follows:

Corrected CSV data showing in Excel.

Excel is removing leading zeros

Excel is very good at removing leading zeros on the user’s behalf. If the user saves a file in Excel as a CSV and re-opens it using Notepad they can see if they have been dropped.

To prevent the zeros from being dropped, you can put an apostrophe at the start of the cell to enforce the leading zeros.

A zero in Excel Four zeros, prefixed with an apostrophe, in Excel Correctly zero-padded data in a CSV file in Notepad.