Skip to content

Commit

Permalink
add subcommand drop,pretty,tail...
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkLoc committed Apr 23, 2024
1 parent 6825de8 commit 282691b
Show file tree
Hide file tree
Showing 18 changed files with 705 additions and 65 deletions.
136 changes: 134 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ atty = "0.2.14"
bzip2 = "0.4.4"
chrono = "0.4.38"
clap = { version = "4.5.4", features = ["derive", "wrap_help"] }
comfy-table = "7.1.1"
csv = "1.3.0"
env_logger = "0.10.0"
flate2 = "1.0.28"
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ Usage: xtab [OPTIONS] [CSV] <COMMAND>
Commands:
addheader Set new header for CSV file [aliases: ah]
dim Dimensions of CSV file
head Get first N records from CSV file
uniq Unique data without sorting
drop Drop or Select CSV fields by columns index
freq freq
head Print first N records from CSV file
pretty Convert CSV to a readable aligned table
tail Print last N records from CSV file
uniq Unique data with keys
view Show CSV file content
help Print this message or the help of the given subcommand(s)


Options:
-h, --help Print help (see more with '--help')
-V, --version Print version
Expand Down
21 changes: 21 additions & 0 deletions example/demo.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sampleid,time,value,bact,FZ69010001,FZ69010002,FZ69010003,FZ69010004,FZ69010005,FZ69010006,FZ69010009,FZ69010011,FZ69010012,FZ69010014
5021150000747,S1,28.16,阳性,G,A,A,C,T,T,T,C,A,AG
5021309000975,S1,NoCt,阳性,0,A,0,0,T,0,T,0,0,0
5020951000970,S1,24.03,阳性,G,A,A,C,T,CT,T,C,A,AG
5021380000841,S1,36.76,阳性,G,A,A,C,T,C,T,C,A,G
5021380000856,S1,19.85,阳性,G,A,A,C,T,C,T,C,A,A
5021309001064,S1,27.36,阳性,G,A,A,C,T,C,T,C,A,A
5021265000525,S1,33,阳性,G,A,A,C,T,T,T,C,A,AG
5021309000755,S1,23.8,阳性,G,A,A,C,T,T,T,C,A,A
5021225001940,S1,37.19,阳性,G,A,A,C,0,C,CT,C,A,G
5021309000987,S1,18.64,阳性,G,A,A,C,T,C,T,C,A,A
5021225001316,S1,20.09,阳性,G,A,A,C,T,C,T,C,A,A
5020951000905,S1,27.38,阳性,G,A,A,C,T,C,T,C,A,G
5021265001963,S1,35.48,阳性,G,A,A,C,0,C,0,0,A,A
5021309000993,S1,26.94,阳性,G,A,A,C,T,C,T,C,A,A
5021309001694,S1,32.07,阳性,G,A,A,C,T,C,T,C,A,A
5021380000846,S1,31.19,阳性,G,A,A,C,T,C,T,C,A,A
5021380000097,S1,28.63,阳性,G,A,A,C,T,C,T,C,A,A
5021309001944,S1,37.26,阳性,0,A,0,C,0,C,0,C,A,A
5021309001684,S1,26.65,阳性,G,A,A,C,T,C,T,C,A,A
5021380001015,S1,36.03,阳性,0,A,0,0,0,C,0,C,0,A
File renamed without changes.
2 changes: 1 addition & 1 deletion example/toy.tsv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
a c
v c
v d
Loading

0 comments on commit 282691b

Please sign in to comment.