如何在unix系统中连接两个文件的列 [英] How to join columns of two files in unix system
本文介绍了如何在unix系统中连接两个文件的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有2个文件,每个文件都有一个包含多行的列,并且每个文件的行都相同.如何将2个文件的列合并在一起,以便最终结果文件有两个列分别来自file1和file2?
I have 2 files, each file has one column with multiple rows and the rows of each file are the same. How can I join the 2 files' columns together so that the final result file has two columns coming from file1 and file2?
例如,file1是:
1
2
3
和file2为:
a
b
c
并且预期的输出是:
1 a
2 b
3 c
推荐答案
只需使用粘贴命令.像这样使用它:粘贴file1 file2
Just use the paste command. Use it like this : paste file1 file2
这篇关于如何在unix系统中连接两个文件的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文