kiluer2005
kiluer2005

Reputation: 103

How to join columns of two files in unix system

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

Upvotes: 10

Views: 13842

Answers (1)

jianpx
jianpx

Reputation: 3320

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

Upvotes: 25

Related Questions