. e.g., \"-k name:u -L name:level.txt Examples data $ cat testdata/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\" By single column : csvtk sort -k 1 or csvtk sort -k last_name in alphabetical order $ cat testdata/names.csv \\ | csvtk sort -k first_name id,first_name,last_name,username 2,Ken,Thompson,ken 11,Rob,Pike,rob NA,Robert,Abel,123 1,Robert,Thompson,abc 4,Robert,Griesemer,gri in reversed alphabetical order ( key:r ) $ cat testdata/names.csv \\ | csvtk sort -k first_name:r id,first_name,last_name,username NA,Robert,Abel,123 1,Robert,Thompson,abc 4,Robert,Griesemer,gri 11,Rob,Pike,rob 2,Ken,Thompson,ken in numerical order ( key:n ) $ cat testdata/names.csv \\ | csvtk sort -k id:n id,first_name,last_name,username NA,Robert,Abel,123 1,Robert,Thompson,abc 2,Ken,Thompson,ken 4,Robert,Griesemer,gri 11,Rob,Pike,rob in natural order ( key:N ) $ cat testdata/names.csv | csvtk sort -k id:N id,first_name,last_name,username 1,Robert,Thompson,abc 2,Ken,Thompson,ken 4,Robert,Griesemer,gri 11,Rob,Pike,rob NA,Robert,Abel,123 in natural order ( key:N ), a bioinformatics example $ echo \"X,Y,1,10,2,M,11,1_c,Un_g,1_g\" | csvtk transpose X Y 1 10 2 M 11 1_c Un_g 1_g $ echo \"X,Y,1,10,2,M,11,1_c,Un_g,1_g\" \\ | csvtk transpose \\ | csvtk sort -H -k 1:N 1 1_c 1_g 2 10 11 M Un_g X Y By multiple columns: csvtk sort -k 1,2 or csvtk sort -k 1 -k 2 or csvtk sort -k last_name,age # by first_name and then last_name $ cat testdata/names.csv | csvtk sort -k first_name -k last_name id,first_name,last_name,username 2,Ken,Thompson,ken 11,Rob,Pike,rob NA,Robert,Abel,123 4,Robert,Griesemer,gri 1,Robert,Thompson,abc # by first_name and then ID $ cat testdata/names.csv | csvtk sort -k first_name -k id:n id,first_name,last_name,username 2,Ken,Thompson,ken 11,Rob,Pike,rob NA,Robert,Abel,123 1,Robert,Thompson,abc 4,Robert,Griesemer,gri By user-defined order # user-defined order/level $ cat testdata/size_level.txt tiny mini small medium big # original data $ cat testdata/size.csv id,size 1,Huge 2,Tiny 3,Big 4,Small 5,Medium $ csvtk sort -k 2:u -i -L 2:testdata/size_level.txt testdata/size.csv id,size 2,Tiny 4,Small 5,Medium 3,Big 1,Huge","title":"sort"},{"location":"usage/#plot","text":"Usage plot common figures Notes: 1. Output file can be set by flag -o/--out-file. 2. File format is determined by the out file suffix. Supported formats: eps, jpg|jpeg, pdf, png, svg, and tif|tiff 3. If flag -o/--out-file not set (default), image is written to stdout, you can display the image by pipping to \"display\" command of Imagemagic or just redirect to file. Usage: csvtk plot [command] Available Commands: box plot boxplot hist plot histogram line line plot and scatter plot Flags: --axis-width float axis width (default 1.5) -f, --data-field string column index or column name of data (default \"1\") --format string image format for stdout when flag -o/--out-file not given. available values: eps, jpg|jpeg, pdf, png, svg, and tif|tiff. (default \"png\") -g, --group-field string column index or column name of group --height float Figure height (default 4.5) -h, --help help for plot --label-size int label font size (default 14) --na-values strings NA values, case ignored (default [,NA,N/A]) --skip-na skip NA values in --na-values --tick-width float axis tick width (default 1.5) --title string Figure title --title-size int title font size (default 16) --width float Figure width (default 6) --x-max string maximum value of X axis --x-min string minimum value of X axis --xlab string x label text --y-max string maximum value of Y axis --y-min string minimum value of Y axis --ylab string y label text Note that most of the flags of plot are global flags of the subcommands hist , box and line Notes of image output Output file can be set by flag -o/--out-file. File format is determined by the out file suffix. Supported formats: eps, jpg|jpeg, pdf, png, svg, and tif|tiff If flag -o/--out-file not set (default), image is written to stdout, you can display the image by pipping to display command of Imagemagic or just redirect to file.","title":"plot"},{"location":"usage/#plot-hist","text":"Usage plot histogram Notes: 1. Output file can be set by flag -o/--out-file. 2. File format is determined by the out file suffix. Supported formats: eps, jpg|jpeg, pdf, png, svg, and tif|tiff 3. If flag -o/--out-file not set (default), image is written to stdout, you can display the image by pipping to \"display\" command of Imagemagic or just redirect to file. Usage: csvtk plot hist [flags] Flags: --bins int number of bins (default 50) --color-index int color index, 1-7 (default 1) Examples example data $ zcat testdata/grouped_data.tsv.gz | head -n 5 | csvtk -t pretty Group Length GC Content Group A 97 57.73 Group A 95 49.47 Group A 97 49.48 Group A 100 51.00 plot histogram with data of the second column: $ csvtk -t plot hist testdata/grouped_data.tsv.gz -f 2 \\ --title Histogram -o histogram.png You can also write image to stdout and pipe to \"display\" command of Imagemagic: $ csvtk -t plot hist testdata/grouped_data.tsv.gz -f 2 | display","title":"plot hist"},{"location":"usage/#plot-box","text":"Usage plot boxplot Notes: 1. Output file can be set by flag -o/--out-file. 2. File format is determined by the out file suffix. Supported formats: eps, jpg|jpeg, pdf, png, svg, and tif|tiff 3. If flag -o/--out-file not set (default), image is written to stdout, you can display the image by pipping to \"display\" command of Imagemagic or just redirect to file. Usage: csvtk plot box [flags] Flags: --box-width float box width --horiz horize box plot Examples plot boxplot with data of the \"GC Content\" (third) column, group information is the \"Group\" column. csvtk -t plot box testdata/grouped_data.tsv.gz -g \"Group\" -f \"GC Content\" \\ --width 3 --title \"Box plot\" \\ > boxplot.png plot horiz boxplot with data of the \"Length\" (second) column, group information is the \"Group\" column. $ csvtk -t plot box testdata/grouped_data.tsv.gz -g \"Group\" -f \"Length\" \\ --height 3 --width 5 --horiz --title \"Horiz box plot\" \\ > boxplot2.png`","title":"plot box"},{"location":"usage/#plot-line","text":"Usage line plot and scatter plot Notes: 1. Output file can be set by flag -o/--out-file. 2. File format is determined by the out file suffix. Supported formats: eps, jpg|jpeg, pdf, png, svg, and tif|tiff 3. If flag -o/--out-file not set (default), image is written to stdout, you can display the image by pipping to \"display\" command of Imagemagic or just redirect to file. Usage: csvtk plot line [flags] Flags: -x, --data-field-x string column index or column name of X for command line -y, --data-field-y string column index or column name of Y for command line --legend-left locate legend along the left edge of the plot --legend-top locate legend along the top edge of the plot --line-width float line width (default 1.5) --point-size float point size (default 3) --scatter only plot points Examples example data $ head -n 5 testdata/xy.tsv Group X Y A 0 1 A 1 1.3 A 1.5 1.5 A 2.0 2 plot line plot with X-Y data $ csvtk -t plot line testdata/xy.tsv -x X -y Y -g Group \\ --title \"Line plot\" \\ > lineplot.png plot scatter $ csvtk -t plot line testdata/xy.tsv -x X -y Y -g Group \\ --title \"Scatter\" --scatter \\ > lineplot.png","title":"plot line"},{"location":"usage/#cat","text":"Usage stream file to stdout and report progress on stderr Usage: csvtk cat [flags] Flags: -b, --buffsize int buffer size (default 8192) -h, --help help for cat -L, --lines count lines instead of bytes -p, --print-freq int print frequency (-1 for print after parsing) (default 1) -s, --total int expected total bytes/lines (default -1) Examples Stream file, report progress in bytes csvtk cat file.tsv Stream file from stdin, report progress in lines tac input.tsv | csvtk cat -L -s `wc -l < input.tsv` -","title":"cat"},{"location":"usage/#genautocomplete","text":"Usage generate shell autocompletion script Supported shell: bash|zsh|fish|powershell Bash: # generate completion shell csvtk genautocomplete --shell bash # configure if never did. # install bash-completion if the \"complete\" command is not found. echo \"for bcfile in ~/.bash_completion.d/* ; do source \\$bcfile; done\" >> ~/.bash_completion echo \"source ~/.bash_completion\" >> ~/.bashrc Zsh: # generate completion shell csvtk genautocomplete --shell zsh --file ~/.zfunc/_csvtk # configure if never did echo 'fpath=( ~/.zfunc \"${fpath[@]}\" )' >> ~/.zshrc echo \"autoload -U compinit; compinit\" >> ~/.zshrc fish: csvtk genautocomplete --shell fish --file ~/.config/fish/completions/csvtk.fish Usage: csvtk genautocomplete [flags] Flags: --file string autocompletion file (default \"/home/shenwei/.bash_completion.d/csvtk.sh\") -h, --help help for genautocomplete --shell string autocompletion type (bash|zsh|fish|powershell) (default \"bash\") /** * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS. * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */ /* var disqus_config = function () { this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable }; */ (function() { // DON'T EDIT BELOW THIS LINE var d = document, s = d.createElement('script'); s.src = '//csvtk.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); Please enable JavaScript to view the comments powered by Disqus.","title":"genautocomplete"}]}
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
index 9e3a073..96fb126 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -2,32 +2,32 @@
None
- 2023-08-23
+ 2023-09-22
daily
None
- 2023-08-23
+ 2023-09-22
daily
None
- 2023-08-23
+ 2023-09-22
daily
None
- 2023-08-23
+ 2023-09-22
daily
None
- 2023-08-23
+ 2023-09-22
daily
None
- 2023-08-23
+ 2023-09-22
daily
\ No newline at end of file
diff --git a/sitemap.xml.gz b/sitemap.xml.gz
index dc4726c..54be9f9 100644
Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ
diff --git a/usage/index.html b/usage/index.html
index 2a2d2a8..5742201 100644
--- a/usage/index.html
+++ b/usage/index.html
@@ -1192,7 +1192,7 @@ csvtk
Usage
csvtk -- a cross-platform, efficient and practical CSV/TSV toolkit
-Version: 0.27.2
+Version: 0.28.0
Author: Wei Shen <shenwei356@gmail.com>
@@ -1286,7 +1286,7 @@ csvtk
-E, --ignore-empty-row ignore empty rows
-I, --ignore-illegal-row ignore illegal rows. You can also use 'csvtk fix' to fix files with
different numbers of columns in rows
- --infile-list string file of input files list (one file per line), if given, they are appended
+ -X, --infile-list string file of input files list (one file per line), if given, they are appended
to files from cli arguments
-l, --lazy-quotes if given, a quote may appear in an unquoted field and a non-doubled quote
may appear in a quoted field
@@ -1666,7 +1666,19 @@ pretty
Usually, the text is wrapped in space (-x/--wrap-delimiter). But if one
word is longer than the -W/--max-width, it will be force split.
1b. Texts are aligned left (default), center (-m/--align-center)
- or right (-r/--align-right).
+ or right (-r/--align-right). Users can specify columns with column names,
+ field indexes or ranges.
+ Examples:
+ -m A,B # column A and B
+ -m 1,2 # 1st and 2nd column
+ -m -1 # the last column (it's not unselecting in other commands)
+ -m 1,3-5 # 1st, from 3rd to 5th column
+ -m 1- # 1st and later columns (all columns)
+ -m -3- # the last 3 columns
+ -m -3--2 # the 2nd and 3rd to last columns
+ -m 1- -r -1 # all columns are center-aligned, except the last column
+ # which is right-aligned. -r overides -m.
+
2. Remaining rows are read and immediately outputted, one by one, till the end.
Styles:
@@ -1745,11 +1757,13 @@ pretty
╚════╩══════╝
Usage:
- csvtk pretty [flags]
+ csvtk pretty [flags]
Flags:
- -m, --align-center strings align center/middle for selected columns (field index or column name)
- -r, --align-right strings align right for selected columns (field index or column name)
+ -m, --align-center strings align right for selected columns (field index/range or column name, type
+ "csvtk pretty -h" for examples)
+ -r, --align-right strings align right for selected columns (field index/range or column name, type
+ "csvtk pretty -h" for examples)
-n, --buf-rows int the number of rows to determine the min and max widths (default 128)
--clip clip longer cell instead of wrapping
--clip-mark string clip mark (default "...")
@@ -1810,7 +1824,7 @@ pretty