【问题标题】:Paste two text lists (one list a file) into one list separated by semicolon将两个文本列表(一个列表一个文件)粘贴到一个以分号分隔的列表中
【发布时间】:2009-10-18 10:33:59
【问题描述】:

流程/输出的一个例子是:

文件1:

hello
world

文件2:

foo
bar

拼接后的文件:

文件3:

hello;foo
world;bar

对于大量非预测性文本(非通配符 - 但行如上对齐)。

我不知道如何在 Ubuntu 下使用粘贴命令来做到这一点。

【问题讨论】:

    标签: linux unix concatenation paste


    【解决方案1】:
    paste -d';' File1 File2  >  File3
    

    【讨论】:

      【解决方案2】:

      cat 按行连接(或者更准确地说,不关心内容是什么)。

      您似乎需要的更像是paste

      $ paste -d\; file1 file2
      hello;foo
      world;bar
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-04-15
        • 1970-01-01
        • 2022-01-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多