Skip to content

Commit

Permalink
fix bug of mutate and add pages
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Apr 10, 2016
1 parent b223b6a commit 9c4f983
Show file tree
Hide file tree
Showing 7 changed files with 368 additions and 22 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# csvtk

Another cross-platform, efficient and practical CSV/TSV tool kit.
Another cross-platform, efficient and practical CSV/TSV toolkit.

## Features

Expand All @@ -15,7 +15,7 @@ Another cross-platform, efficient and practical CSV/TSV tool kit.
Just [download](https://github.com/shenwei356/csvtk/releases) executable file
of your operating system and rename it to `csvtk.exe` (Windows) or
`csvtk` (other operating systems) for convenience.

You can also add the directory of the executable file to environment variable
`PATH`, so you can run `csvtk` anywhere.

Expand All @@ -32,34 +32,34 @@ You can also add the directory of the executable file to environment variable

**Information**

- [x] `stat` summary of CSV file
- `stat` summary of CSV file

**Format convertion**

- [x] `csv2tab` convert CSV to tabular format
- [x] `tab2csv` convert tabular format to CSV
- [x] `space2tab` convert space delimited format to CSV
- [x] `transpose` transpose CSV data
- `csv2tab` convert CSV to tabular format
- `tab2csv` convert tabular format to CSV
- `space2tab` convert space delimited format to CSV
- `transpose` transpose CSV data

**Set operations**

- [x] `cut` select parts of fields
- [x] `uniq` unique data without sorting
- [x] `inter` intersection of multiple files
- [x] `grep` grep data by selected fields with patterns/regular expressions
- `filter` filter data by values of selected fields, supporting math/string expression
- [x] `join` join multiple CSV files by selected fields
- `cut` select parts of fields
- `uniq` unique data without sorting
- `inter` intersection of multiple files
- `grep` grep data by selected fields with patterns/regular expressions
- `filter` filter data by values of selected fields, supporting math/string expression (not impelemented yet)
- `join` join multiple CSV files by selected fields

**Edit**

- [x] `rename` rename column names
- [x] `rename2` rename column names by regular expression
- [x] `replace` replace data of selected fields by regular expression
- [x] `mutate` create new columns from selected fields by regular expression
- `rename` rename column names
- `rename2` rename column names by regular expression
- `replace` replace data of selected fields by regular expression
- `mutate` create new columns from selected fields by regular expression

**Ordering**

- [x] `sort` sort by selected fields
- `sort` sort by selected fields

## Compared to `csvkit`

Expand Down Expand Up @@ -103,12 +103,12 @@ to be continued...

1. Edit data with regular expression (`replace`)

- e.g. remove Chinese charactors: `csvtk replace -F -f "*_name" -p "\p{Han}+" -r ""`
- Remove Chinese charactors: `csvtk replace -F -f "*_name" -p "\p{Han}+" -r ""`

1. Create new column from selected fields by regular expression (`mutate`)

- In default, copy a column: `csvtk mutate -f id `
- e.g. extract prefix of data as group name (get "A" from "A.1" as group name):
- Extract prefix of data as group name (get "A" from "A.1" as group name):
`csvtk mutate -f sample -n group -p "^(.+?)\."`

1. Sort by multiple keys (`sort`)
Expand Down
4 changes: 2 additions & 2 deletions csvtk/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "csvtk",
Short: "Another cross-platform, efficient and practical CSV/TSV tool kit",
Long: `Another cross-platform, efficient and practical CSV/TSV tool kit
Short: "Another cross-platform, efficient and practical CSV/TSV toolkit",
Long: `Another cross-platform, efficient and practical CSV/TSV toolkit
Version: 0.2.1
Expand Down
35 changes: 35 additions & 0 deletions doc/docs/download.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Download

`csvtk` is implemented in [Golang](https://golang.org/) programming language,
executable binary files **for most popular operating system** are freely available
in [release](https://github.com/shenwei356/csvtk/releases) page.

## Current Version

- [csvtk v0.2.1](https://github.com/shenwei356/csvtk/releases/tag/v0.2.1)
- fix bug of `mutate`

## Installation

Just [download](https://github.com/shenwei356/csvtk/releases) executable file
of your operating system and rename it to `csvtk.exe` (Windows) or
`csvtk` (other operating systems) for convenience,
and then run it in command-line interface, no dependencies,
no complicated compilation process.

You can also add the directory of the executable file to environment variable
`PATH`, so you can run `csvtk` anywhere.

1. For windows, the simplest way is copy it to `C:\WINDOWS\system32`.

2. For Linux, type:

chmod a+x /PATH/OF/FASTCOV/csvtk
echo export PATH=\$PATH:/PATH/OF/FASTCOV >> ~/.bashrc

or simply copy it to `/usr/local/bin`

## Previous Versions

- [csvtk v0.2](https://github.com/shenwei356/csvtk/releases/tag/v0.2)
- finish almost functions
1 change: 1 addition & 0 deletions doc/docs/index.md
Loading

0 comments on commit 9c4f983

Please sign in to comment.