Closed alvanuffelen closed 9 months ago
Hmm, they are treated as empty rows and skipped since v0.26.0.
This is problematic in your situation, I should make it optional with
-E, --ignore-empty-row ignore empty rows
That's sad, the official csv reader skip blank lines by default, and no option to disable this.
https://pkg.go.dev/encoding/csv
Blank lines are ignored. A line with only whitespace characters (excluding the ending newline character) is not considered a blank line.
Some guys tried to change this but failed., the PR was not accepted.
A workaround way: add the row number with the global flag -Z/--show-row-num
, which would stop del-header
removing blank lines
$ cat example.txt | csvtk cut -f species -Z | csvtk del-header | csvtk cut -f -1 | wc -l
162
$ cat example.txt | wc -l
163
Prerequisites
csvtk version
Describe your issue
csvtk del-header
on one column removes the empty cells. example.txtEmpty cells are included:
Empty cells are removed: