Contents

Theory about applications - [TA2]

Question
Summarize the main aspects of the CSV protocol RFC 4180 (definition and rules)

Features to define a standard CSV file

  1. Each record is located on a separate line, delimited by a line break (CRLF).
  2. The last record in the file may or may not have an ending line break.
  3. There maybe an optional header line appearing as the first line of the file with the same format as normal record lines. This header will contain names corresponding to the fields in the file and should contain the same number of fields as the records in the rest of the file.
  4. Within the header and each record, there may be one or more fields, separated exclusively by commas. Each line should contain the same number of fields throughout the file. The last field in the record must not be followed by a comma.
  5. Each field may or may not be enclosed in double quotes.
  6. Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes.
  7. If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote.

Sources