Skip to content

Commit

Permalink
v0.31.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Nov 22, 2024
1 parent d20aa89 commit 10afed2
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 43 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
- [csvtk v0.31.1](https://github.com/shenwei356/csvtk/releases/tag/v0.31.1)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/csvtk/v0.31.1/total.svg)](https://github.com/shenwei356/csvtk/releases/tag/v0.31.1)
- `csvtk filter2/mutate2/mutate3`:
- fix the slow speed, I was stupid before. []#172](https://github.com/shenwei356/csvtk/issues/172)
- fix the slow speed, I was stupid before. [#172](https://github.com/shenwei356/csvtk/issues/172)
- `csvtk csv2json`:
- further fix values with double quotes and new line symbols. [#291](https://github.com/shenwei356/csvtk/issues/291)
- [csvtk v0.31.0](https://github.com/shenwei356/csvtk/releases/tag/v0.31.0)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/csvtk/v0.31.0/total.svg)](https://github.com/shenwei356/csvtk/releases/tag/v0.31.0)
- new command:
- `csvtk mutate3`: create a new column from selected fields with Go-like expressions. Contributed by @moorereason [172](https://github.com/shenwei356/csvtk/issues/172)
- `csvtk sort/join`:
- faster speed and lower memory.
- `csvtk sort`:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ It could save you lots of time in (not) writing Python/R scripts.
- [`round`](https://bioinf.shenwei.me/csvtk/usage/#round): round float to n decimal places
- [`mutate`](https://bioinf.shenwei.me/csvtk/usage/#mutate): creates new columns from selected fields by regular expression
- [`mutate2`](https://bioinf.shenwei.me/csvtk/usage/#mutate2): creates a new column from selected fields by awk-like arithmetic/string expressions
- [`mutate3`](https://bioinf.shenwei.me/csvtk/usage/#mutate3): create a new column from selected fields with Go-like expressions
- [`fmtdate`](https://bioinf.shenwei.me/csvtk/usage/#fmtdate): format date of selected fields

**Transform**
Expand Down
3 changes: 1 addition & 2 deletions csvtk/cmd/mutate3.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ func doMutate3(config Config, opts mutate3Opts) {
var selectWithColnames bool
var record2 []string // for output
keys := make([]string, 0, 8)
decimalFormat := fmt.Sprintf("%%.%df", opts.DecimalWidth)

checkFirstLine := true
for record := range csvReader.Ch {
Expand Down Expand Up @@ -405,8 +406,6 @@ func doMutate3(config Config, opts mutate3Opts) {
program, err = expr.Compile(exprStr1, customFuncs...)
checkError(err)

decimalFormat := fmt.Sprintf("%%.%df", opts.DecimalWidth)

// check result
if hasNullCoalescence {
result, err = expr.Run(program, parameters2)
Expand Down
86 changes: 47 additions & 39 deletions doc/docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,25 @@

## Current Version

- [csvtk v0.31.0](https://github.com/shenwei356/csvtk/releases/tag/v0.31.0)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/csvtk/v0.31.0/total.svg)](https://github.com/shenwei356/csvtk/releases/tag/v0.31.0)
- `csvtk sort/join`:
- faster speed and lower memory.
- `csvtk sort`:
- do not panic for empty input. [#287](https://github.com/shenwei356/csvtk/issues/287)
- `csvtk summary`:
- fix the order of columns. [#282](https://github.com/shenwei356/csvtk/issues/282)
- `csvtk rename2`:
- fix `-n/--start-num`. [#286](https://github.com/shenwei356/csvtk/issues/286)
- add flag `--nr-width`.
- `csvtk replace`:
- fix implementing `{nr}`. [#286](https://github.com/shenwei356/csvtk/issues/286)
- [csvtk v0.31.1](https://github.com/shenwei356/csvtk/releases/tag/v0.31.1)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/csvtk/v0.31.1/total.svg)](https://github.com/shenwei356/csvtk/releases/tag/v0.31.1)
- `csvtk filter2/mutate2/mutate3`:
- fix the slow speed, I was stupid before. [#172](https://github.com/shenwei356/csvtk/issues/172)
- `csvtk csv2json`:
- fix values with double quotes and new line symbols.
- `csvtk split`:
- support customize output file prefix and subdirectory from prefix of keys. [#288](https://github.com/shenwei356/csvtk/issues/288)
- `csvtk spread`:
- add a new alias "scatter" to "spread". [#265](https://github.com/shenwei356/csvtk/issues/265)
- `csvtk grep`:
- do not show progress.
- `csvtk fix-quotes`:
- new flag `-b, --buffer-size`.
- `csvtk plot`:
- new flag `--scale` for scaling the image width/height, tick, axes, line/point and font sizes proportionally, adviced by @tseemann.
- `csvtk plot line`:
- only add legend for more than one group. [#279](https://github.com/shenwei356/csvtk/issues/279)
- sort points by X for plotting lines. [#280](https://github.com/shenwei356/csvtk/issues/280)
- `csvtk hist`:
- new flags: `--line-width`.
- `csvtk box`:
- plots of different groups have different colors now.
- new flags: `--line-width`, `--point-size`, and `color-index`.
- further fix values with double quotes and new line symbols. [#291](https://github.com/shenwei356/csvtk/issues/291)


### Links

OS |Arch |File, 中国镜像 |Download Count
:------|:---------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Linux |32-bit |[csvtk_linux_386.tar.gz](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_linux_386.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_linux_386.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_linux_386.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_linux_386.tar.gz)
Linux |**64-bit**|[**csvtk_linux_amd64.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_linux_amd64.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_linux_amd64.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_linux_amd64.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_linux_amd64.tar.gz)
Linux |**64-bit**|[**csvtk_linux_arm64.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_linux_arm64.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_linux_arm64.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_linux_arm64.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_linux_arm64.tar.gz)
macOS |**64-bit**|[**csvtk_darwin_amd64.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_darwin_amd64.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_darwin_amd64.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_darwin_amd64.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_darwin_amd64.tar.gz)
macOS |**arm64** |[**csvtk_darwin_arm64.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_darwin_arm64.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_darwin_arm64.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_darwin_arm64.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_darwin_arm64.tar.gz)
Windows|32-bit |[csvtk_windows_386.exe.tar.gz](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_windows_386.exe.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_windows_386.exe.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_windows_386.exe.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_windows_386.exe.tar.gz)
Windows|**64-bit**|[**csvtk_windows_amd64.exe.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_windows_amd64.exe.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_windows_amd64.exe.tar.gz)|[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_windows_amd64.exe.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.0/csvtk_windows_amd64.exe.tar.gz)
Linux |32-bit |[csvtk_linux_386.tar.gz](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_linux_386.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_linux_386.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_linux_386.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_linux_386.tar.gz)
Linux |**64-bit**|[**csvtk_linux_amd64.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_linux_amd64.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_linux_amd64.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_linux_amd64.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_linux_amd64.tar.gz)
Linux |**64-bit**|[**csvtk_linux_arm64.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_linux_arm64.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_linux_arm64.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_linux_arm64.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_linux_arm64.tar.gz)
macOS |**64-bit**|[**csvtk_darwin_amd64.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_darwin_amd64.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_darwin_amd64.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_darwin_amd64.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_darwin_amd64.tar.gz)
macOS |**arm64** |[**csvtk_darwin_arm64.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_darwin_arm64.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_darwin_arm64.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_darwin_arm64.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_darwin_arm64.tar.gz)
Windows|32-bit |[csvtk_windows_386.exe.tar.gz](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_windows_386.exe.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_windows_386.exe.tar.gz) |[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_windows_386.exe.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_windows_386.exe.tar.gz)
Windows|**64-bit**|[**csvtk_windows_amd64.exe.tar.gz**](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_windows_amd64.exe.tar.gz),<br/> [中国镜像](http://app.shenwei.me/data/csvtk/csvtk_windows_amd64.exe.tar.gz)|[![Github Releases (by Asset)](https://img.shields.io/github/downloads/shenwei356/csvtk/latest/csvtk_windows_amd64.exe.tar.gz.svg?maxAge=3600)](https://github.com/shenwei356/csvtk/releases/download/v0.31.1/csvtk_windows_amd64.exe.tar.gz)

**Notes**

Expand Down Expand Up @@ -166,6 +139,41 @@ fish:

## Release history

- [csvtk v0.31.0](https://github.com/shenwei356/csvtk/releases/tag/v0.31.0)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/csvtk/v0.31.0/total.svg)](https://github.com/shenwei356/csvtk/releases/tag/v0.31.0)
- new command:
- `csvtk mutate3`: create a new column from selected fields with Go-like expressions. Contributed by @moorereason [172](https://github.com/shenwei356/csvtk/issues/172)
- `csvtk sort/join`:
- faster speed and lower memory.
- `csvtk sort`:
- do not panic for empty input. [#287](https://github.com/shenwei356/csvtk/issues/287)
- `csvtk summary`:
- fix the order of columns. [#282](https://github.com/shenwei356/csvtk/issues/282)
- `csvtk rename2`:
- fix `-n/--start-num`. [#286](https://github.com/shenwei356/csvtk/issues/286)
- add flag `--nr-width`.
- `csvtk replace`:
- fix implementing `{nr}`. [#286](https://github.com/shenwei356/csvtk/issues/286)
- `csvtk csv2json`:
- fix values with double quotes and new line symbols.
- `csvtk split`:
- support customize output file prefix and subdirectory from prefix of keys. [#288](https://github.com/shenwei356/csvtk/issues/288)
- `csvtk spread`:
- add a new alias "scatter" to "spread". [#265](https://github.com/shenwei356/csvtk/issues/265)
- `csvtk grep`:
- do not show progress.
- `csvtk fix-quotes`:
- new flag `-b, --buffer-size`.
- `csvtk plot`:
- new flag `--scale` for scaling the image width/height, tick, axes, line/point and font sizes proportionally, adviced by @tseemann.
- `csvtk plot line`:
- only add legend for more than one group. [#279](https://github.com/shenwei356/csvtk/issues/279)
- sort points by X for plotting lines. [#280](https://github.com/shenwei356/csvtk/issues/280)
- `csvtk hist`:
- new flags: `--line-width`.
- `csvtk box`:
- plots of different groups have different colors now.
- new flags: `--line-width`, `--point-size`, and `color-index`.
- [csvtk v0.30.0](https://github.com/shenwei356/csvtk/releases/tag/v0.30.0)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/csvtk/v0.30.0/total.svg)](https://github.com/shenwei356/csvtk/releases/tag/v0.30.0)
- `csvtk`:
Expand Down
Loading

0 comments on commit 10afed2

Please sign in to comment.