美文网首页
2019-10-25 shell script 处理 CSV

2019-10-25 shell script 处理 CSV

作者: 七点水Plus | 来源:发表于2019-10-25 17:40 被阅读0次

    https://stackoverflow.com/questions/9506810/add-column-to-end-of-csv-file-using-awk-in-bash-script

    vim input.txt

    2012-02-29,01:00:00,Manhattan,New York,234
    2012-02-29,01:00:00,Manhattan,New York,843
    2012-02-29,01:00:00,Manhattan,New York,472
    2012-02-29,01:00:00,Manhattan,New York,516

    cat input.txt >> input.csv

    $ cat input.csv
    2012-02-29,01:00:00,Manhattan,New York,234
    2012-02-29,01:00:00,Manhattan,New York,843
    2012-02-29,01:00:00,Manhattan,New York,472
    2012-02-29,01:00:00,Manhattan,New York,516


    shell script 处理 CSV 文件(Excel)
    https://www.jianshu.com/p/f8c3cb0d822b

    save to csv

    printf "Host,Data\n" >> test.csv
    printf "yuanxion,20191025\n" >> test.csv
    printf "xy18,20191026" >> test.csv

    相关文章

      网友评论

          本文标题:2019-10-25 shell script 处理 CSV

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