【问题标题】:How can I add two or more text files into one text file with columns?? (under Linux or Windows)如何将两个或多个文本文件添加到一个带有列的文本文件中? (在 Linux 或 Windows 下)
【发布时间】:2017-07-28 19:35:22
【问题描述】:

我有 2 个文本文件:

[root@srv32 ~]# cat test1.txt 
apple
orange
grapes
banana
cherry

[root@srv32 ~]# cat test2.txt 
carrot
lettuce
garlic
artichoke
lemon

我想在不同的列中加入这两个文件,所以输出如下所示:

[root@srv32 ~]# cat testfinal.txt 
apple carrot
orange lettuce
grapes garlic
banana artichoke
cherry lemon

知道我该怎么做吗?谢谢

【问题讨论】:

  • 您在寻找pate吗?

标签: linux text grep cat


【解决方案1】:

在 linux 中你使用命令paste:

paste test1.txt test2.txt > testfinal.txt

在 Windows 中,我认为你必须牺牲一只山羊或其他东西。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-23
    • 2020-12-29
    • 2013-05-23
    • 2020-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-07
    相关资源
    最近更新 更多