RFC 4180, "Common Format and MIME Type for Comma-Separated Values (CSV) Files", October 2005Source of RFC: IETF - NON WORKING GROUP
Area Assignment: app
Errata ID: 6230
Publication Format(s) : TEXT
Reported By: Marco Diniz Sousa
Date Reported: 2020-07-13
Section 2 says:
The last record in the file may or may not have an ending line break. file = [header CRLF] record *(CRLF record) [CRLF]
It should say:
The last record in the file must have an ending line break. file = [header CRLF] record *(CRLF record) CRLF
The grammar seems to be ambiguous in the case below:
- Records have just one field;
- The last record may have an empty value.
In the file above, we do not know if we have four records (header1, a, b and an empty value) with the last record not ending with a line break; or if we have three records (header1, a and b) with the last record ending with a line break.
The grammar allows empty fields:
non-escaped = *TEXTDATA
According to RFC 2234:
"Default values are 0 and infinity so that *<element> allows any number, including zero;"