Join txt files with diff cols and rows

I am a new user of Unix/Linux, so this question might be a bit simple!
I am trying to join two (very large) files that both have different # of cols and rows in each file.
I want to keep 'all' rows and 'all' cols from both files in the joint file, and the primary key variables are in the rows.
I need all rows that exist in both files to be matched up and joined. However, those rows not in one file or the other should also be kept and their data maintained in the joint file. Basically, all possible max data to be included in joint file.
Hope this makes sense!

small example of files:

file 1 =
A 1 2 3 4
B 1 2
C 1 2 3 4 5

file 2 =
A 1 2 3 4 5
B 1 2 3
C 1 2 3
D 1 2 3 4 5 6
E 1

Joint file should have =
A 1 2 3 4 5
B 1 2 3
C 1 2 3 4 5
D 1 2 3 4 5 6
E 1

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

1 Like