Add the following code to your project's shard.yml under:
dependencies
to use in production
- OR -
development_dependencies
to use in development
Parse 2d tabular data bettwen YAML, JSON, CSV.
brew tap weaming/tap
brew install tabular
git clone https://github.com/weaming/tablib
crystal build --release src/tabular.cr
mv tabular /usr/local/bin
$ ./tabular --help
tabular -- Convert between CSV, JSON, YAML. The JSON is the bridge betwwen CSV and YAML.
Usage:
tabular [options] [arguments] ...
Options:
-f FILE, --file=FILE The file [type:String] [default:"/dev/stdin"]
-t TYPE, --type Allow CSV or YAML [type:String] [default:"YAML"]
-i, --indent Option description. [type:Int32] [default:2]
--help Show this help.
--version Show version.
Add to your .vimrc
" brew install tabular
nnoremap <a-l> :%!tabular -f /dev/stdin -t yaml<CR>
nnoremap <a-c> :%!tabular -f /dev/stdin -t csv<CR>
git clone
shards install
crystal run src/tabular.cr -- -f test.json -t csv
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)