3 ms·
According to the manual [1] the format requires that field names match [a-zA-Z%][a-zA-Z0-9_]* but it allows any characters in the value other than an unescaped
by networked 12y ago
According to the manual [1] the format requires that field names match [a-zA-Z%][a-zA-Z0-9_]* but it allows any characters in the value other than an unescaped newline. For example, the command
echo "\"country\",population\nÖsterreich,8.58" | csv2rec --strict | rec2csv
works as expected. Somewhat worryingly, the format specification does not say anything about \0. I'd rather see use of \0 explicitly prohibited.
I have found one place where the field name rule may not be enforced properly. It appears that csv2rec will use a noncompliant column name from a CSV file header as a key even in strict mode; however, rec2csv or relset will not accept the output it generates as input. I.e.,
echo "Österreich_population\n8.58" | csv2rec --strict | rec2csv
blows up on rec2csv rather than on csv2rec (which is what I think should happen).
[1] http://www.gnu.org/software/recutils/manual/recutils.html#The-Rec-Format http://www.gnu.org/software/recutils/manual/recutils.html#Th...