Home Man
Today's Posts

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

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.
The Following User Says Thank You to fpmurphy For This Useful Post:
BNasir (09-13-2011)
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Diff 3 files, but diff only their 2nd column kenshinhimura Shell Programming and Scripting 10 03-18-2015 11:20 AM
Need help in splitting the string to diff rows rithushri Shell Programming and Scripting 4 04-25-2013 06:11 AM
Transpose Datefield from rows to column + Print time diff asnandhakumar Shell Programming and Scripting 6 10-22-2012 04: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 04:15 PM
[diff] hide missing rows, show similar Evan UNIX for Dummies Questions & Answers 2 02-16-2012 01:37 PM
join rows based on the column values vsachan Shell Programming and Scripting 3 11-03-2011 05:07 PM
how to join files with diff col # and row #? BNasir UNIX for Dummies Questions & Answers 1 09-14-2011 02:30 PM
Join 2 files with multiple columns: awk/grep/join? InfoSeeker UNIX for Dummies Questions & Answers 3 12-01-2009 07:45 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 06:00 PM.

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