#csv #csv-tsv #tsv #version

app xtab

xtab: CSV command line utilities

8 releases

0.0.8 May 20, 2024
0.0.7 May 15, 2024
0.0.5 Apr 26, 2024
0.0.1 Oct 8, 2023

#1776 in Command line utilities

Download history 16/week @ 2024-03-29 2/week @ 2024-04-05 317/week @ 2024-04-19 190/week @ 2024-04-26 1/week @ 2024-05-03 265/week @ 2024-05-10 213/week @ 2024-05-17 12/week @ 2024-05-24

476 downloads per month

MIT license



🦀 CSV command line utilities


setp1:install cargo first
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install xtab
# or

git clone https://github.com/sharkLoc/xtab.git
cd xtab
cargo b --release
# mv target/release/xtab to anywhere you want 


xtab -- CSV command line utilities
Version: 0.0.8

Authors: sharkLoc <mmtinfo@163.com>
Source code: https://github.com/sharkLoc/xtab.git

xtab supports reading and writing gzip/bzip2/xz format file.
Compression level:
  format   range   default   crate
  gzip     1-9     6         https://crates.io/crates/flate2
  bzip2    1-9     6         https://crates.io/crates/bzip2
  xz       1-9     6         https://crates.io/crates/xz2

Usage: xtab [OPTIONS] [CSV] <COMMAND>

  addheader  Set new header for CSV file [aliases: ah]
  csv2xlsx   Convert CSV/TSV files to XLSX file [aliases: c2x]
  dim        Dimensions of CSV file
  drop       Drop or Select CSV fields by columns index
  flatten    flattened view of CSV records [aliases: flat]
  freq       Build frequency table of selected column in CSV data
  head       Print first N records from CSV file
  pretty     Convert CSV to a readable aligned table [aliases: prt]
  replace    Replace data of matched fields
  reverse    Reverses rows of CSV data [aliases: rev]
  sample     Randomly select rows from CSV file using reservoir sampling
  search     Applies the regex to each field individually and shows only matching rows
  slice      Slice rows from a part of a CSV file
  tail       Print last N records from CSV file
  transpose  Transpose CSV data [aliases: trans]
  uniq       Unique data with keys
  xlsx2csv   Convert XLSX to CSV format [aliases: x2c]
  view       Show CSV file content
  help       Print this message or the help of the given subcommand(s)

Global Arguments:
  -d, --delimiter <CHAR>      Set delimiter for input csv file, e.g., in linux -d $'\t' for tab, in powershell -d `t for tab [default: ,]
  -D, --out-delimite <CHAR>   Set delimiter for output CSV file, e.g., in linux -D $'\t' for tab, in powershell -D `t for tab [default: ,]
      --log <FILE>            If file name specified, write log message to this file, or write to stderr
      --compress-level <INT>  Set compression level 1 (compress faster) - 9 (compress better) for gzip/bzip2/xz output file, just work with option -o/--out [default: 6]
  -v, --verbosity...          control verbosity of logging, [-v: Error, -vv: Warn, -vvv: Info, -vvvv: Debug, -vvvvv: Trace, defalut: Debug]
  [CSV]                   Input CSV file name, if file not specified read data from stdin

Global FLAGS:
  -H, --no-header  If set, the first row is treated as a special header row, and the original header row excluded from output
  -q, --quiet      Be quiet and do not show any extra information
  -h, --help       prints help information
  -V, --version    prints version information

Use "xtab help [command]" for more information about a command


~485K SLoC