MeridianMERIDIAN

CSV Record

container.object.csv

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

Shape

Pattern
^[^,]+(,[^,]+)*$
ValueLengthShape
John,30,true12matches
"Smith, John",30,Engineer25matches

Told apart

Going the other way, this type's own rule accepts 6 of 6 samples of HTML Content, 3 of 3 samples of JSON Object, 3 of 3 samples of JSON Array, 5 of 5 samples of S-Expression, 2 of 2 samples of XML Document and 2 of 2 samples of YAML Document.

Background

Origin

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

RFC 4180, Common Format and MIME Type for Comma-Separated Values (CSV) Files, was written by Y. Shafranovich and published in October 2005.[2] RFC 4180 is an Informational RFC and states that it does not specify an Internet standard of any kind.[2] 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] RFC 4180 registers the MIME type text/csv.[2] RFC 4180 describes its definition as the format that seems to be followed by most implementations.[2]

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

Use

CSV is commonly used in software that deals with tabular data, such as databases and spreadsheets.[1]

RFC 4180 notes that, because there is no single specification, there are considerable differences among CSV implementations.[2] The Python csv module's documentation says that subtle differences often exist in the CSV data produced and consumed by different applications.[3]

Python's csv.reader accepts any iterable of strings, most commonly a file-like object or a list.[3] 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]

Where you'll meet it

The Library of Congress says its collections held over 840,000 CSV files as of May 2024.[4] The Library of Congress Recommended Formats Statement includes CSV as a preferred format for datasets.[4]

Detection notes

v1 migration: New for v2. CSV is typically a multi-row format, but may appear as individual records in some contexts. Parsing requires explicit schema.

Use it

CLI · DuckDB
$ finetype infer -i "John,30,true" --mode column
→ container.object.csv

SELECT ft_infer('John,30,true');
-- → 'container.object.csv'
Cast expression
CAST({col} AS VARCHAR)

Schema

https://meridian.online/schemas/container.object.csv · Frictionless type string

finetype taxonomy container.object.csv -o json-schema

Aliases

csv_rowdelimited_record

Type Registry