美文网首页
Translations Between Text Files

Translations Between Text Files

作者: 大地缸 | 来源:发表于2021-02-08 19:50 被阅读0次

    title: "Translations Between Text Files Like Csv Json and So On"
    date: 2021-02-06T08:20:20+08:00
    draft: true
    tags: ['text','format']
    author: "dadigang"
    author_cn: "大地缸"
    personal: "http://www.real007.cn"


    关于作者

    http://www.real007.cn/about

    re-txt

    reformates a text file from a structure to another, i.e: convert from json to yaml, toml to json, ... etc

    Supported Source Formats

    • json
    • yaml
    • hcl
    • toml
    • csv

    Supported Target Formats

    • json
    • yaml
    • toml

    Examples

    # json to yaml using flag
    $ re-txt --src example.json json2yaml
    
    # json to yaml using stdin pipe
    $ cat example.json | re-txt json2yaml
    
    # csv to yaml by first converting to json
    $ cat example.csv | re-txt csv2json | re-txt json2yaml
    
    # csv to yaml by first converting to json
    # also merge multiple json files and convert the piped result & them into yaml
    $ cat example.csv | re-txt csv2json | re-txt --dest ./result.yaml --src=another1.json --src=another2.json json2yaml
    

    Installations

    • from source: go get github.com/alash3al/re-txt
    • binary download: go to there and download the binary which support your env

    相关文章

      网友评论

          本文标题:Translations Between Text Files

          本文链接:https://www.haomeiwen.com/subject/cwgntltx.html