![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| join two files | koti_rama | Shell Programming and Scripting | 5 | 08-05-2008 01:20 AM |
| Join two files | koti_rama | Shell Programming and Scripting | 4 | 06-10-2008 03:15 AM |
| how to join files | jxh461 | UNIX for Dummies Questions & Answers | 5 | 08-23-2007 04:11 AM |
| Sum of Files Sizes starting with a letter... | pbsrinivas | Shell Programming and Scripting | 2 | 07-25-2007 05:21 AM |
| Join Files | choppas | Shell Programming and Scripting | 2 | 10-18-2006 07:03 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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 $? |
|
#3
|
|||
|
|||
|
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! |
|
#4
|
|||
|
|||
|
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 . |
|
#5
|
||||
|
||||
|
Hi.
If you are still having trouble, then post the smallest sample -- including data, commands, and results -- that fails for you so that we can provide specific help ... cheers, drl |
||||
| Google The UNIX and Linux Forums |