Convert CSV records to TSV: Difference between revisions
Content added Content deleted
m (→{{header|J}}) |
m (→{{header|J}}) |
||
Line 157: | Line 157: | ||
Here, also, we interpret "nonsense" as starting immediately after a closing quote which is not followed by a delimiter, and ending immediately before the most immediately following newline. |
Here, also, we interpret "nonsense" as starting immediately after a closing quote which is not followed by a delimiter, and ending immediately before the most immediately following newline. |
||
For csv parsing we first break out fields using [[j:Vocabulary/semico#dyadic|;:]]. Here, each field is preceded by a delimiter. (We discard an optional trailing newline from the csv text and prepend a newline at the beginning so that every field has a preceding delimiter. Also, of course, if we were given a file reference, we work with the text of the file rather than its name.) |
For csv parsing we first break out fields using <b><tt>[[j:Vocabulary/semico#dyadic|;:]]</tt></b>. Here, each field is preceded by a delimiter. (We discard an optional trailing newline from the csv text and prepend a newline at the beginning so that every field has a preceding delimiter. Also, of course, if we were given a file reference, we work with the text of the file rather than its name.) |
||
Then, these fields are formed into rows (fields which begin with newlines start a new row), and each field is stripped of delimiters and non-textual quotes are removed. |
Then, these fields are formed into rows (fields which begin with newlines start a new row), and each field is stripped of delimiters and non-textual quotes are removed. |