简体   繁体   中英

BASH print 2 files

I want to print the output of file1 to first column in new file and file 2 to the second column in the new file.

Something like this.

file1  
AAA    
BBB  
CCC    

file2
XXX   
YYY   
ZZZ  

file3   
AAA   XXX
BBB   YYY
CCC   ZZZ

paste command will do this job out-of-the-box:

paste file1 file2 > file3
AAA     XXX   
BBB     YYY   
CCC     ZZZ

Try this click here

You can use paste and format using cut to remove leading and trailing spaces

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM