What is CSV File Format?


CSV stands for Comma Separated Value. It is a plain text file that stores tables and spreadsheets information. It contains a table of texts, numbers or dates. CSV file can be easily imported and exported by a number of applications like Outlook, Thunderbird, Lotus Notes, etc. CSV files can be opened by spreadsheet programs like Microsoft Excel, OpenOffice Calc, Google Sheets, or any text editor.

Usually, the first line in a CSV file consists of the table column labels. Each of the subsequent lines represent a row of the table. Commas separate each cell in the row, where in the name comes from. Example of a CSV file. It has three columns, labeled ‘name’, ‘id’, and ‘food items’ and it has 5 rows including the header row.

Name, id, favorite food

Gabriel, 1, hot dog

Abbey, 2, Pizza

Ethan, 3, ice cream

Brayden, 4, cereals

Here is how that file looks in a spreadsheet

A B C
1 Name Id Favorite Food
2 Gabriel 1 Hot dog
3 Abbey 2 Pizza
4 Ethan 3 Ice cream
5 Brayden 4 Cereals

History

CSV is a data format and is used for interchange of database information between machines of two different architectures. It is approved in 1978. Comma Separated Value or CSV abbreviation were in use by 1983.These files are human-readable.

With RFC 4180, the main standardization initiative is taken for CSV file to make it more precise format. Later in 2013, some of RFC4180’s deficiencies were tackled by W3C recommendation.

In 2014 IETF published RFC7111 describing application of URI fragments to CSV documents. In 2015, W3C make an attempt to enhance CSV with formal semantics.

Specifications of CSV File

RFC 4180 represents specifications for CSV format however, actual practice does not allow RFC and the term CSV might refer to any file format.

  • A plain text using a set of character set such as ASCII, various Unicode character sets
  • Consists of records
  • With the records divided into fields separated by delimiters
  • Where every record has same sequence of fields.

With these general constraints, many variations are in use. So, without additional information, a file claimed simply to be CSV format.