From c3fa7547ddff33ab163c5684056979a93a862f77 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 2 Apr 2015 01:16:40 +0100 Subject: [PATCH] Updates regarding line breaks --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f4f11ee..720c0c5 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,12 @@ character used in any given input CSV-like formatted file/data. - **Header** — The first row is often used to contain the column names for all remaining rows. Header names would be used as key names when CSV data is converted to JSON for example. -- **Line Break** — Line breaks in CSV files should be CRLF (`\r\n`). -- **CRLF** — Means the standard line break used by Windows. It is a carriage - return character (CR or `\r`) and a line feed character (LF or `\n`). +- **Line Break** — Line breaks in CSV files can be CRLF (`\r\n`), LF (`\n`), + and even in rare cases CR (`\r`). +- **LF, CR, and CRLF** — Different types of line breaks, typically determined + by the OS. Linux, OSX, and other *NIX operating systems generally use a line + feed (LF or `\n`) character. Windows uses a carriage return (CR or `\r`) and + a line feed character, effectively "CRLF" (`\r\n`). ## CSV Format Definition @@ -69,7 +72,7 @@ character used in any given input CSV-like formatted file/data. ### Rules 1. Each record starts at the beginning of its own line, and ends with a line - break (CRLF). + break (shown as `¬`). CSV: @@ -269,6 +272,10 @@ character used in any given input CSV-like formatted file/data. CSV data is indistinguishable from actual integer numbers. - Null/Nil values should be rendered as empty strings. +12. All forms of line breaks (CRLF, LF, and CR) should be supported when + parsing input CSV data. When rendering output CSV data, CRLF should be + used for line breaks to ensure maximum cross-platform compatibility. + ## License