How to join columns of two files in unix system

☆樱花仙子☆ 提交于 2021-02-20 06:20:20

问题


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?

For example, file1 is:

1
2
3

and file2 is:

a
b
c

and the expected output is:

1   a
2   b
3   c

回答1:


Just use the paste command. Use it like this : paste file1 file2



来源:https://stackoverflow.com/questions/12361977/how-to-join-columns-of-two-files-in-unix-system

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!