Skip to content

Commit

Permalink
rename stat to stats and stat2 to stats2
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Mar 10, 2017
1 parent aa39c31 commit be2cdba
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 26 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

## Introduction

Similar to FASTA/Q format in field of Bioinformatics,
Similar to FASTA/Q format in field of Bioinformatics,
CSV/TSV formats are basic and ubiquitous file formats in both Bioinformatics and data sicence.

People usually use spreadsheet softwares like MS Excel to do process table data.
Expand Down Expand Up @@ -68,8 +68,8 @@ It could save you much time of writing Python/R scripts.
**Information**

- `headers` print headers
- `stat` summary of CSV file
- `stat2` summary of selected number fields
- `stats` summary of CSV file
- `stats2` summary of selected digital fields

**Format conversion**

Expand Down Expand Up @@ -201,7 +201,7 @@ Examples
1 Robert Thompson abc
NA Robert Abel 123

1. Summary of selected number fields: num, sum, min, max, mean, stdev (`stat2`)
1. Summary of selected digital fields: num, sum, min, max, mean, stdev (`stat2`)

$ cat digitals.tsv
4 5 6
Expand Down Expand Up @@ -287,7 +287,7 @@ Examples

## Acknowledgements

We are grateful to [Zhiluo Deng](https://github.com/dawnmy) and
We are grateful to [Zhiluo Deng](https://github.com/dawnmy) and
[Li Peng](https://github.com/penglbio) for suggesting features and reporting bugs.

## Contact
Expand Down
5 changes: 3 additions & 2 deletions csvtk/cmd/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import (

// statCmd represents the stat command
var statCmd = &cobra.Command{
Use: "stat",
Short: "summary of CSV file",
Use: "stats",
Aliases: []string{"stat"},
Short: "summary of CSV file",
Long: `summary of CSV file
`,
Expand Down
7 changes: 4 additions & 3 deletions csvtk/cmd/stat2.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ import (

// stat2Cmd represents the stat2 command
var stat2Cmd = &cobra.Command{
Use: "stat2",
Short: "summary of selected number fields",
Long: `summary of selected number fields: num, sum, min, max, mean, stdev
Use: "stats2",
Aliases: []string{"stats2"},
Short: "summary of selected digital fields",
Long: `summary of selected digital fields: num, sum, min, max, mean, stdev
`,
Run: func(cmd *cobra.Command, args []string) {
Expand Down
7 changes: 4 additions & 3 deletions doc/docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/csvtk/v0.7.0/total.svg)](https://github.com/shenwei356/csvtk/releases/tag/v0.7.0)

- fig bug of "stricter field checking" in v0.6.0 and v0.6.1 when using flag `-F/--fuzzy-fields`
- `csvtk pretty` and `csvtk csv2md`: add attention that
these commands treat the first row as header line and require them to be unique.
- `csvtk stat` renamed to `csvtk stats`, old name is still available as an alias.
- `csvtk stat2` renamed to `csvtk stats2`, old name is still available as an alias.
- [issues/13](https://github.com/shenwei356/csvtk/issues/13) **seamlessly support data with meta line of separator declaration used by MS Excel**, e.g.,

$ cat names_with_meta.csv
Expand All @@ -25,9 +29,6 @@
11,Rob,Pike,rob
4,Robert,Griesemer,gri

- `csvtk pretty` and `csvtk csv2md`: add attention that
these commands treat the first row as header line and require them to be unique.


Links:

Expand Down
29 changes: 16 additions & 13 deletions doc/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
**Information**

- [headers](#headers)
- [stat](#stat)
- [stat2](#stat2)
- [stats](#stats)
- [stats2](#stats2)

**Format conversion**

Expand Down Expand Up @@ -71,7 +71,7 @@ Usage
```
A cross-platform, efficient and practical CSV/TSV toolkit
Version: 0.6.0
Version: 0.7.0-dev2
Author: Wei Shen <[email protected]>
Expand Down Expand Up @@ -114,8 +114,8 @@ Available Commands:
sample sampling by proportion
sort sort by selected fields
space2tab convert space delimited format to CSV
stat summary of CSV file
stat2 summary of selected number fields
stats summary of CSV file
stats2 summary of selected number fields
tab2csv convert tabular format to CSV
transpose transpose CSV data
uniq unique data without sorting
Expand Down Expand Up @@ -163,15 +163,18 @@ $ csvtk headers testdata/*.csv$
3 hobby
```

## stat
## stats

Usage

```
summary of CSV file
Usage:
csvtk stat [flags]
csvtk stats [flags]
Aliases:
stats, stat
```

Expand All @@ -187,7 +190,7 @@ Examples
1,"Robert","Thompson","abc"
NA,"Robert","Abel","123"

$ cat testdata/names.csv | csvtk stat
$ cat testdata/names.csv | csvtk stats
file num_cols num_rows
- 4 5

Expand All @@ -199,7 +202,7 @@ Examples
7 8 0
8 1,000 4

$ cat testdata/digitals.tsv | csvtk stat -t -H
$ cat testdata/digitals.tsv | csvtk stats -t -H
file num_cols num_rows
- 3 4

Expand All @@ -208,10 +211,10 @@ Examples
Usage

```
summary of selected number fields: num, sum, min, max, mean, stdev
summary of selected digital fields: num, sum, min, max, mean, stdev
Usage:
csvtk stat2 [flags]
csvtk stats2 [flags]
Flags:
-f, --fields string select only these fields. e.g -f 1,2 or -f columnA,columnB
Expand All @@ -223,7 +226,7 @@ Examples

1. simplest one

$ seq 1 5 | csvtk stat2 -H -f 1
$ seq 1 5 | csvtk stats2 -H -f 1
field num sum min max mean stdev
1 5 15 1 5 3 1.58

Expand All @@ -235,7 +238,7 @@ Examples
7 8 0
8 1,000 4

$ cat testdata/digitals.tsv | csvtk stat2 -t -H -f 1-3
$ cat testdata/digitals.tsv | csvtk stats2 -t -H -f 1-3
field num sum min max mean stdev
1 4 20 1 8 5 3.16
2 4 1,015 2 1,000 253.75 497.51
Expand Down

0 comments on commit be2cdba

Please sign in to comment.