Fandom

File Formats Wiki

Comma-separated values

261pages on
this wiki
Add New Page
Talk0 Share
Comma-separated values
Blank

Filename extension .csv, .txt +
Internet media type text/csv
Type Tabular data
spreadsheet file format
Standard RFC 4180
Opens with Any text editor
File formats category - v  e   edit
Smallwikipedialogo.png Wikipedia has an article related to:

A comma-separated values file stores tables in data form. Each line is a row in the table, and cells in each row are separated by commas.

SpecificationEdit

There are many variations of the CSV format.

  • Each line is separated with a line break. A line break at the end of the file is optional.
  • Cells in each row are delimited by a comma.

Example:

spam,2:40,rock
eggs,1:32,jazz
noodles,4:52,hiphop

spam 2:40 rock
eggs 1:32 jazz
noodles 4:52 hiphop
  • Depending on the implementation, for each cell, leading and trailing spaces are trimmed. For example, in the RFC 4180, spaces are not trimmed and are considered part of the cell.
  • If a cell contains a comma, the whole cell must be enclosed in double quotes:

spam,2:40,"Hormyl Music Co., Ltd.",rock

spam 2:40 Hormyl Music Co., Ltd.

If we didn't place quotes, it would look like:

spam 2:40 Hormyl Music Co. Ltd.
  • The same goes for a line break within the cell:

spam,2:40,"It's really good
I can feel it"

spam 2:40 It's really good
I can feel it
  • The same goes for a quotation mark within the cell. The quotation mark is replaced by two quotation marks.

spam,"It's ""really""good"

spam It's "really" good
  • Depending on the implementation, the same goes for leading and trailing spaces:

spam,"  Hoooormyyl  "

spam   Hoooormyyl  

External linksEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.