# CSV Record

Key: `container.object.csv`

Single CSV record or row stored as a delimited string. Format: value1,value2,value3 (may include quoted values).

Page: <https://meridian.online/docs/projects/finetype/types/container/object/csv>

Samples: `John,30,true`, `"Smith, John",30,Engineer`

## Background

### Origin

The comma-separated values format predates personal computers by more than a decade.[[1]](https://en.wikipedia.org/wiki/Comma-separated_values) The IBM Fortran (level H extended) compiler under OS/360 supported list-directed input and output, with commas between values, in 1972.[[1]](https://en.wikipedia.org/wiki/Comma-separated_values) The term "comma-separated value" and the abbreviation CSV were in use by 1983.[[1]](https://en.wikipedia.org/wiki/Comma-separated_values)

RFC 4180, Common Format and MIME Type for Comma-Separated Values (CSV) Files, was written by Y. Shafranovich and published in October 2005.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) RFC 4180 is an Informational RFC and states that it does not specify an Internet standard of any kind.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) RFC 4180 says that the CSV format had been used for exchanging data between spreadsheet programs for quite some time but had never been formally documented.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) RFC 4180 registers the MIME type text/csv.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) RFC 4180 describes its definition as the format that seems to be followed by most implementations.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt)

In the RFC 4180 grammar, a record is one or more fields separated by commas.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) RFC 4180 says that fields containing line breaks, double quotes or commas should be enclosed in double quotes.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) RFC 4180 says that a double quote inside a quoted field must be escaped by preceding it with another double quote.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) RFC 4180 says that spaces are part of a field and should not be ignored.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) RFC 4180 says that the last field in a record must not be followed by a comma.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt)

### Use

CSV is commonly used in software that deals with tabular data, such as databases and spreadsheets.[[1]](https://en.wikipedia.org/wiki/Comma-separated_values)

RFC 4180 notes that, because there is no single specification, there are considerable differences among CSV implementations.[[2]](https://www.rfc-editor.org/rfc/rfc4180.txt) The Python csv module's documentation says that subtle differences often exist in the CSV data produced and consumed by different applications.[[3]](https://docs.python.org/3/library/csv.html)

Python's csv.reader accepts any iterable of strings, most commonly a file-like object or a list.[[3]](https://docs.python.org/3/library/csv.html) Python's csv.reader returns each row as a list of strings and performs no automatic data type conversion unless the QUOTE\_NONNUMERIC option is set.[[3]](https://docs.python.org/3/library/csv.html)

### Where you'll meet it

The Library of Congress says its collections held over 840,000 CSV files as of May 2024.[[4]](https://www.loc.gov/preservation/digital/formats/fdd/fdd000323.shtml) The Library of Congress Recommended Formats Statement includes CSV as a preferred format for datasets.[[4]](https://www.loc.gov/preservation/digital/formats/fdd/fdd000323.shtml)

## Sources

1. [Comma-separated values](https://en.wikipedia.org/wiki/Comma-separated_values) — secondary source
2. [Common Format and MIME Type for Comma-Separated Values (CSV) Files](https://www.rfc-editor.org/rfc/rfc4180.txt) — standard
3. [csv — CSV file reading and writing](https://docs.python.org/3/library/csv.html) — documentation
4. [CSV, Comma Separated Values (RFC 4180)](https://www.loc.gov/preservation/digital/formats/fdd/fdd000323.shtml) — organisation
