【问题标题】:How to filter by column name?如何按列名过滤?
【发布时间】:2016-02-04 15:26:19
【问题描述】:

我有一个 csv 文件。我想过滤它并只保留标题以“命中”开头的列。我该怎么做?

小例子输入:

hit1,miss1,hit2,miss2
a,0,d,0
b,0,e,0
c,0,f,0

期望的输出:

hit1,hit2
a,d
b,e
c,f

我想我想要exclude 命令,但我不知道语法

【问题讨论】:

    标签: csvfix


    【解决方案1】:

    order 命令可让您指定要包含在输出中的列名的包含列表:

    csvfix order -fn hit1,hit2 data.csv
    

    (我意识到我参加聚会迟到了,但也许这对下一个人有帮助。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-26
      • 2018-09-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多