![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| join two files | koti_rama | Shell Programming and Scripting | 5 | 08-05-2008 04:20 AM |
| Join two files | koti_rama | Shell Programming and Scripting | 4 | 06-10-2008 06:15 AM |
| how to join files | jxh461 | UNIX for Dummies Questions & Answers | 5 | 08-23-2007 07:11 AM |
| Sum of Files Sizes starting with a letter... | pbsrinivas | Shell Programming and Scripting | 2 | 07-25-2007 08:21 AM |
| Join Files | choppas | Shell Programming and Scripting | 2 | 10-18-2006 10:03 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Join - files of different sizes
I am trying to join to files with dramatically different sizes (file 1: 1 column - 9000 rows, file 2: 13 cols, 26 million rows). I can't seem to get join to work. I have check to ensure that there are matches and have tried subsamples that work. The -a filenum flag lists all the rows, so join is indeed doing something. Is there a reason that disproportionate files will not join?
Cheers! |
|
||||
|
If both files are sorted in the same collating sequence and the same direction for the key fields, you do get output regardless of a disparity in size.
If there is no match for an item in file1, you get no output. Is there a possibility of producing cartesian products in the result set? What status code does join return? Code:
join file1 file2 ...... echo $? |
|
||||
|
Join - files of different sizes
Right, so my files are sorted in (numerical ) order on the field that is being joined (1). The result of the join is 0. That is:
Code:
$ join -1 1 -2 1 File1 File2 $ echo $? 0 Cheers! |
|
||||
|
For successful execution of join commd make sure the length of the
field are same on which you want to join both the file say for exmp . if the first file is having the lenght 8 digit make sure the second file too have 8 digit for that use %.8d hence the field will have eight digit and if any particular record have six digit that will be read like 00123456 and like wise and you can join both the file regardless of the numbers of records. You may give example for more details. I hope I have made it clear . |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|