Excel CSV Format

Top  Previous  Next

 

Note that we recommend that Excel be used to generate import CSV files. In Excel, click File – Save As… and select CSV (MS DOS) from the ‘Save as type’ drop down box. The format specification below is provided for those for whom it is not possible to use Excel.

 

The Excel CSV Format is an ASCII text file containing a number of fields per line with each field delimited by a comma character.

Some text,5675,some more text,more text still

 

In some cases, however you will want to include comma characters in a particular field. To achieve this, the field is enclosed in double quotes.

"Address1, Address2, Address3",a field without commas,",,,,,,,"

 

There are some other characters, which also cause a field to become enclosed in double quotes. Of note are the double quote character and a carriage return/linefeed pair, which signals a new line.

"This string has ""double quotes"" as part of the field","This string has a carriage return"

 

Note that a single double quote character is represented as two double quotes, when within a field. Also note that though this example takes up two lines in a text editor, it is still considered one line of the CSV. It would correspond to the following example in Excel. To add a new line to a field in Excel use Alt-Enter.

 

Excel example

Excel example