gpt4 book ai didi

linux - 加入两个txt文件

转载 作者:太空宇宙 更新时间:2023-11-04 09:05:15 24 4
gpt4 key购买 nike

使用 Linux:*.txt 文件

文件1

HOUSAM000001189870 1012212222011212100020102102112011002200111112012220110 ....... 
HOUSAM000001213135 2012012000120120102010201002102111200122201100222201102 .......
HOUSAM000001237057 0012011222010210120120122210000101112000222210102010201 .......
HOUSAM000001239242 2210120111010010100100022001111000010220010102010201022 .......

文件2

HOUSAM000001189870     
HOUSAM000001237057

输出文件

HOUSAM000001189870 1012212222011212100020102102112011002200111112012220110 .......
HOUSAM000001237057 0012011222010210120120122210000101112000222210102010201 .......

最佳答案

join 命令与 sort 结合使用:

$ join <(sort 1.txt) <(sort 2.txt)
4046 200344
4047 200122
4050 200001

关于linux - 加入两个txt文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12994134/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com