Join txt files with diff cols and rows

Tags
columns, join, linux, perl, shell scripts, unix

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 09-13-2011
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
# 2  
Old 09-13-2011
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.
This User Gave Thanks to fpmurphy For This Post:
BNasir (09-13-2011)
Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Join Lines every paragraph in a file.txt lxdorney Shell Programming and Scripting 7 10-09-2016 05:00 PM
Diff 3 files, but diff only their 2nd column kenshinhimura Shell Programming and Scripting 10 03-18-2015 12:20 PM
Compare two txt files,mismatches will be in new txt files Ankita Talukdar Shell Programming and Scripting 5 12-27-2013 11:11 AM
How to join 2 .txt files based on a common column? alisrpp UNIX for Dummies Questions & Answers 1 05-18-2013 01:10 AM
Need help in splitting the string to diff rows rithushri Shell Programming and Scripting 4 04-25-2013 07:11 AM
Transpose Datefield from rows to column + Print time diff asnandhakumar Shell Programming and Scripting 6 10-22-2012 05:23 PM
How to use the the join command to join multiple files by a common column evelibertine UNIX for Dummies Questions & Answers 5 07-05-2012 05:15 PM
how to join two files using "Join" command with one common field in this problem? mindfreak UNIX for Dummies Questions & Answers 2 04-13-2012 06:55 AM
[diff] hide missing rows, show similar Evan UNIX for Dummies Questions & Answers 2 02-16-2012 02:37 PM
join rows based on the column values vsachan Shell Programming and Scripting 3 11-03-2011 06:07 PM
how to join files with diff col # and row #? BNasir UNIX for Dummies Questions & Answers 1 09-14-2011 03:30 PM
Join 2 files with multiple columns: awk/grep/join? InfoSeeker UNIX for Dummies Questions & Answers 3 12-01-2009 08:45 PM
list files .txt and .TXT in one command thepurple Solaris 4 12-31-2008 09:32 AM
join cols from multi files into one file vbshuru Shell Programming and Scripting 2 11-20-2003 12:52 PM
diff 2 files; output diff's to 3rd file blt123 Shell Programming and Scripting 2 05-28-2002 12:29 PM
All times are GMT -4. The time now is 12:53 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.