Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanderploegsma/transpose
Learning Go: Transposes tables or matrices from the command line
https://github.com/sanderploegsma/transpose
cli command-line command-line-tool
Last synced: 3 days ago
JSON representation
Learning Go: Transposes tables or matrices from the command line
- Host: GitHub
- URL: https://github.com/sanderploegsma/transpose
- Owner: sanderploegsma
- Created: 2018-08-03T09:41:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-15T14:57:35.000Z (over 1 year ago)
- Last Synced: 2024-06-21T06:47:00.760Z (5 months ago)
- Topics: cli, command-line, command-line-tool
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Transpose
This command line utility transposes tables and matrices:
```
|A1|B1|C1| |A1|A2|A3|
|A2|B2|C2| => |B1|B2|B3|
|A3|B3|C3| |C1|C2|C3|
```It will automatically infer the table style, so this works too:
```
A1,B1,C1 A1,A2,A3
A2,B2,C2 => B1,B2,B3
A3,B3,C3 C1,C2,C3
```## Installation
You can install using Homebrew:``` bash
brew install sanderploegsma/tap/transpose
```## Usage
Currently, it reads from STDIN and writes to STDOUT:``` bash
$ cat << EOF | transpose
|A1|B1|C1|
|A2|B2|C2|
|A3|B3|C3|
EOF
# output:
# |A1|A2|A3|
# |B1|B2|B3|
# |C1|C2|C3|
```*Tip:* Use `pbpaste` and `pbcopy` on macOS:
``` bash
pbpaste | transpose | pbcopy
```### Options
To see a list of supported options, use
``` bash
transpose -h
```