Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Join txt files with diff cols and rows

Shell Programming and Scripting


Tags
columns, join, linux, perl, unix

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-13-2011   -   Original Discussion by BNasir
BNasir's Unix or Linux Image
BNasir BNasir is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 13 September 2011, 10:25 PM EDT
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Unix or Linux Question 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
Sponsored Links
    #2  
Old Unix and Linux 09-13-2011   -   Original Discussion by BNasir
fpmurphy's Unix or Linux Image
fpmurphy fpmurphy is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 12 June 2016, 11:03 PM EDT
Location: /dev/ph
Posts: 4,996
Thanks: 73
Thanked 475 Times in 437 Posts
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.
The Following User Says Thank You to fpmurphy For This Useful Post:
BNasir (09-13-2011)
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Deleting specific rows in large files having rows greater than 100000 manish2009 Shell Programming and Scripting 9 12-11-2009 12:17 PM
Join 2 files with multiple columns: awk/grep/join? InfoSeeker UNIX for Dummies Questions & Answers 3 12-01-2009 07:45 PM
Find duplicates from multuple files with 2 diff types of files ricky007 Shell Programming and Scripting 2 03-04-2008 12:46 PM
join cols from multi files into one file vbshuru Shell Programming and Scripting 2 11-20-2003 11:52 AM
diff 2 files; output diff's to 3rd file blt123 Shell Programming and Scripting 2 05-28-2002 11:29 AM



All times are GMT -4. The time now is 07:27 PM.