Closed tseemann closed 3 years ago
New flags
-m, --allow-missing-col allow missing column
-b, --blank-missing-col blank missing column
Tests
$ cat foo.csv | csvtk cut -f D,A,C,B -m | csvtk pretty
A B
- -
1 2
3 4
$ cat foo.csv | csvtk cut -f D,A,C,B -m -b | csvtk pretty
D A C B
- - - -
1 2
3 4
$ cat foo.csv | csvtk cut -f 5,2,4,1 -m | csvtk pretty
B A
- -
2 1
4 3
$ cat foo.csv | csvtk cut -f 5,2,4,1 -m -b
,B,,A
,2,,1
,4,,3
Binaries
Awesome! Thanks @shenwei356 !
This would be usefulf or cleaning large datatsets that I need to merge or get partial versions from different sources.