Releases: shenwei356/csvtk
Releases · shenwei356/csvtk
csvtk v0.3.5.1
fix minor bug of a dependency package. When reading lines ending with \r\n
(usually from Windows OS), error will occur:
no data found in file test.csv
csvtk v0.3.5
- fix minor bug of
csv2md
- add subcommand
version
which could check for update
_Recompiled at 2016-06-06 due to changed output of subcommand version
_
csvtk v0.3.4
- fix bug of
csvtk replace
that head row should not be edited.
csvtk v0.3.3
- fix bug of
csvtk grep -t -P
csvtk v0.3.2
- fix bug of
inter
csvtk v0.3.1
- add support of searching multiple fields for `grep`
_update 2016-04-24_
recompile due to bugfix of dependencies (https://github.com/shenwei356/util/)
csvtk v0.3
- add subcommand
csv2md
csv2md
Usage
convert CSV to markdown format
Usage:
csvtk csv2md [flags]
Flags:
-a, --alignments string comma separated alignments. e.g. -a l,c,c,c or -a c
-w, --min-width int min width (default 3)
Examples
-
give single alignment symbol
$ cat names.csv | csvtk csv2md -a left id |first_name|last_name|username :--|:---------|:--------|:------- 11 |Rob |Pike |rob 2 |Ken |Thompson |ken 4 |Robert |Griesemer|gri 1 |Robert |Thompson |abc NA |Robert |Abel |12
result:
id first_name last_name username 11 Rob Pike rob 2 Ken Thompson ken 4 Robert Griesemer gri 1 Robert Thompson abc NA Robert Abel 12 -
give alignment symbols of all fields
$ cat names.csv | csvtk csv2md -a c,l,l,l id |first_name|last_name|username :-:|:---------|:--------|:------- 11 |Rob |Pike |rob 2 |Ken |Thompson |ken 4 |Robert |Griesemer|gri 1 |Robert |Thompson |abc NA |Robert |Abel |123
result
id first_name last_name username 11 Rob Pike rob 2 Ken Thompson ken 4 Robert Griesemer gri 1 Robert Thompson abc NA Robert Abel 123
csvtk v0.2.9
- add more flags to subcommand
pretty
- fix bug of
csvtk cut -n
- add subcommand
filter
filter
Usage
filter data by values of selected fields with math expression
Usage:
csvtk filter [flags]
Flags:
--any print record if any of the field satisfy the condition
-f, --filter string filter condition. e.g. -f "age>12" or -f "1,3<=2" or -F -f "c*!=0" --or
-F, --fuzzy-fields using fuzzy fileds, e.g. *name or id123*
Examples
-
single field
$ cat names.csv id,first_name,last_name,username 11,"Rob","Pike",rob 2,Ken,Thompson,ken 4,"Robert","Griesemer","gri" 1,"Robert","Thompson","abc" NA,"Robert","Abel","123" $ cat names.csv | csvtk filter -f "id>0" | csvtk pretty id first_name last_name username 11 Rob Pike rob 2 Ken Thompson ken 4 Robert Griesemer gri 1 Robert Thompson abc
-
multiple fields
$ cat digitals.tsv 4 5 6 1 2 3 7 8 0 8 1,000 4 $ cat digitals.tsv | csvtk -t -H filter -f "1-3>0" 4 5 6 1 2 3 8 1,000 4
using
--any
to print record if any of the field satisfy the condition$ cat digitals.tsv | csvtk -t -H filter -f "1-3>0" --any 4 5 6 1 2 3 7 8 0 8 1,000 4
-
fuzzy fields
$ cat names.csv | csvtk filter -F -f "i*!=0" id,first_name,last_name,username 11,Rob,Pike,rob 2,Ken,Thompson,ken 4,Robert,Griesemer,gri 1,Robert,Thompson,abc
csvtk v0.2.8
pretty
Usage
convert CSV to readable aligned table
Usage:
csvtk pretty [flags]
Flags:
-r, --align-right align right
-s, --separator string fields/columns separator (default " ")
Examples:
-
default
$ csvtk pretty names.csv id first_name last_name username 11 Rob Pike rob 2 Ken Thompson ken 4 Robert Griesemer gri 1 Robert Thompson abc NA Robert Abel 123
-
align right
$ csvtk pretty names.csv -r id first_name last_name username 11 Rob Pike rob 2 Ken Thompson ken 4 Robert Griesemer gri 1 Robert Thompson abc NA Robert Abel 123
-
custom separator
$ csvtk pretty names.csv -s " | " id | first_name | last_name | username 11 | Rob | Pike | rob 2 | Ken | Thompson | ken 4 | Robert | Griesemer | gri 1 | Robert | Thompson | abc NA | Robert | Abel | 123
csvtk v0.2.7
- fix highlight failing in windows