(Video materials in preparation)
fromcsv : CSV Filter
Usage : fromcsv <file>
Option : -n <null_string>
-z <zero_string>
-s <space_character>
-e
-q
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 3
Converts a CSV file to a space-delimited file.
If the file name is not specified or is "-" then this
command expects input on standard input.
1. Data that is recognized as comma-delimited includes
string 0 (not enclosed in double-quotes) and "string 1"
(enclosed in double quotes).
2. Empby string 0 is converted to 0, empty-string 1 is
converted to "_".
(-z option changes 0 in string0,
-n option changes _ in string 1)
3. Escaped double quotes inside string 1 are converted to single ".
You cannot use double quotes in string 0.
4. Half-width spaces inside any string are converted to "_"
(-s option changes _)
5. -e option precedes "_" (or the charcter specfied by -s option) and
"\" by "\".
6. -q option eliminate preceding "\" form "\"" and "\\".
7. \r\n at the end of a line is automatically converted to \n.
8. Any \n inside string 1 is converted to "\n".
9. The final line does not require a linefeed (\n).
$ cat data
,"",3,"a_b","cde
f\gh","i j","k,""l"
$ fromcsv data
0 _ 3 a_b cde\nf\gh i_j k,"l
$ fromcsv -e data
0 _ 3 a\_b cde\nf\\gh i_j k,"l
RFC (in Japanese)
http://www.kasai.fm/wiki/rfc4180jp