CSV File Format - Comma Delimited Files and Excel Files

Last updated on 11/28/2012

How to Generate a CSV File with Excel

A CSV is the exchange format mostly used for transferring data between applications. You can export an excel spreadsheet to a CSV formatted file when you save your excel document and change the "Save as Type" to "CSV (Comma Delimited) (*.csv)"

The section below explains in more detail what is a CSV file and the format of the data field expected in the file.

What is a CSV File

A comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted instead, as binary numbers. A CSV file consists of any number of records, separated by line breaks of some kind; each record consists of fields, separated by some other character or string, most commonly a literal comma or tab. Usually, all records have an identical sequence of fields.

"CSV" is not a single, well-defined format (although see RFC 4180 for one definition that is commonly used). Rather, in practice the term "CSV" refers to any file that:

  • is plain text using a character set such as ASCII, Unicode, EBCDIC, or Shift JIS,
  • consists of records (typically one record per line),
  • with the records divided into fields separated by delimiters (typically a single reserved character such as comma, semicolon, or tab; sometimes the delimiter may include optional spaces),
  • where every record has the same sequence of fields.

Source: wikipedia http://en.wikipedia.org/wiki/Comma-separated_values