Convert CSV records to TSV: Difference between revisions

Content added Content deleted
m ("robustness" in quotation marks)
Line 8: Line 8:
the operating system.
the operating system.


In accordance with the robustness principle of processing, if a string or
In accordance with the so-called robustness principle of processing, if a string or
input line begins with a valid (possibly empty) sequence of comma-separated
input line begins with a valid (possibly empty) sequence of comma-separated
values but is followed by nonsense, then processing should continue based on
values but is followed by nonsense, then processing should continue based on
Line 33: Line 33:
so there is no need to express that as a restriction in the PEG.
so there is no need to express that as a restriction in the PEG.


; Robustness
; "Robustness"
As mentioned above, if an input line or string begins with a valid sequence of
As mentioned above, if an input line or string begins with a valid sequence of
comma-separated values but is followed by nonsense, then processing should
comma-separated values but is followed by nonsense, then processing should
Line 97: Line 97:
; TEST FILE
; TEST FILE
The test file should include a line with a RETURN ('\r') character.
The test file should include a line with a RETURN ('\r') character.
One way to change the RETURN in the following to the '\r' control character would be
One way to change the first RETURN in the following to the '\r' control character would be
to use `sed`, perhaps along the lines of: sed -i.bak $'s/RETURN/\r/' TEST.csv
to use `sed`, perhaps along the lines of: sed -i.bak $'s/RETURN/\r/' TEST.csv
<pre>
<pre>