Open jidanni opened 3 years ago
This example on the man page,
while (my $row = $csv->getline ($fh)) {
$row->[2] =~ m/pattern/ or next; # 3rd field should match
push @rows, $row;
}
shows how to kick out lines after processing. It would be nice to do it also before processing.
Or say "It is 1000 times easier to do
$ grep -v ^# file.csv > file.csv.tmp
and then read that, then all other ways."
OK, for headers => "auto"
users, as long as the first line of the file isn't a comment, one can use:
my $aoh = csv(
in => pop,
headers => "auto", # strict => 1 alas, can't use here, as our comments are being parsed
filter => {
1 => sub { !m/^#/ }, # jump over commented lines
}
);
OK, that is for commenting out entire lines.
Now we turn to the case of how to add a comment to the ends of lines, like e.g., on can do in Perl itself.
So perhaps mention this hack:
zoom-levels,projection-false-origin-x,projection-false-origin-y,update-delay,type,server,comment
comment
can contain anything, except a comma...
Emacs has
Therefore the Text::CSV man page should mention something about comments. E.g., "Not allowed!"