FAQs
Contents
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:
… and with file extensions shown:
There is a difference in icons too:
While smaller, they are visible in Outlook as well:
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.
The above will display in Excel as follows:
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:
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:
In this instance, this is due to the row 3 column 1 having a comma in it:
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:
This will then display in Excel as follows:
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.