Comments on Linux Join Command Tutorial for Beginners (5 Examples)

Sometimes, you may want to combine two files in a way that the output makes even more sense. For example, there could be a file containing name of continents, and another file containing names of countries located in these continents, and the requirement is to combine both files in a way that a continent and the corresponding country appear in the same line.

2 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: girish

Hi,

 

I have 2 files as below :

file 1 

60102000212|20180824160000|BLANK|24

60102002248|20181114160000|BLANK|24

60102005258|20180117160000|BLANK|24

60102006195|20180130160000|BLANK|24

 

 

file 2 :

60102000212|20180825000000|20200824000000|24

60102002248|20181115000000|20201115000000|24

60102005258|20180118000000|20200118000000|24

60102006196|BLANK|BLANK|BLANK

 

I want the output to merge 

60102000212|20180824160000|BLANK|24|60102000212|20180825000000|20200824000000|24

60102002248|20181114160000|BLANK|24|60102002248|20181115000000|20201115000000|24

60102005258|20180117160000|BLANK|24|60102005258|20180118000000|20200118000000|24

60102006195|20180130160000|BLANK|24||||

||||60102006196|BLANK|BLANK|BLANK

By: sadegh

Hi, I have joined two file using the commond. the out put is splited by ^M

It means that the output file is not uniform