如何将一系列文件并排连接在一起而不会看到输出中的列之间有任何间隙?

zar*_*ara 4 linux command

如何将多个文件连接在一起,以使最终输出中的列之间没有任何间隙?例如,如果以下是两个输入: input1.txt

22211 21111 11111 
22222 22222 11111
22222 11111 23211
Run Code Online (Sandbox Code Playgroud)

输入2.txt

22211 21111  
22222 20002 
22222 11111 
Run Code Online (Sandbox Code Playgroud)

我希望我的输出是这样的:

22211 21111 11111 22211 21111 
22222 22222 11111 22222 20002 
22222 11111 23211 22222 20002 
Run Code Online (Sandbox Code Playgroud)

但问题是当我使用这个命令时:

paste input1.txt input2.txt > out.txt
Run Code Online (Sandbox Code Playgroud)

然后 out.txt 上有一个空白,其中两个文件连接在一起,例如:

22211 21111 11111     22211 21111 
22222 22222 11111     22222 20002 
22222 11111 23211     22222 20002
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能看不到这个差距?我应该提到我有 37 个 txt 文件(hap1.txt hap2.txt ..hap37.txt),我希望将它们并排连接在一起。请问有什么建议吗?

mur*_*uru 8

那个间隙是一个标签。只需告诉paste您要使用空格作为分隔符而不是制表符。来自man paste

-d, --delimiters=LIST
      reuse characters from LIST instead of TABs
Run Code Online (Sandbox Code Playgroud)

例子:

$ paste -d' ' input1 input2
22211 21111 11111 22211 21111  
22222 22222 11111 22222 20002 
22222 11111 23211 22222 11111 
Run Code Online (Sandbox Code Playgroud)