![]() |
|
|
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 (pls help on join command) | summer_cherry | Shell Programming and Scripting | 1 | 12-31-2007 05:19 AM |
| Join Command Help | jerome Sukumar | Shell Programming and Scripting | 0 | 01-25-2007 03:08 AM |
| Using Join Command | Supial | Shell Programming and Scripting | 4 | 08-09-2005 02:12 AM |
| Join command | unisam | UNIX for Dummies Questions & Answers | 4 | 07-28-2004 07:59 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
join command
Hi,
I'm using the join command and it appears to discard certain fields. Here are the two files i'm comparing: File1: 1 a 2 b 3 c 4 d 99 f 101 g 999 i 200 j File 2: 1 e 2 f 3 g 4 h 99 h 101 i 999 j 200 k > join 1 2 results in: 1 a e 2 b f 3 c g 4 d h 99 f h 999 i j So 101 and 200 have been ignored....any ideas why? Cheers |
|
||||
|
adding a tab to the output
Thanks - you were right it was because it wasn't correctly sorted.
Does anyone know how to add a tab to the output of the join command i.e. the fields that are added should be seperated from the rest with a tab? e.g. 1 g </tab> h 3 g </tab> i Cheers ![]() |
|
||||
|
more join problems
Well here's my join issue
I have a file in the following format: id/name/salary/position and a file in the following format number,amount,id if I use sed to replace the different separators with a ":" and try to join them - the join fails to match on id. However if I type the files in with the : separator already in place - the join works fine. Sadly I am the instructor - and tested the script with my pre-made files (with the ":") but assigned the work with different separators to make the class use sed to convert them. Both files are sorted (ascii) and other than the separators are identical. Anyone have a clue as to why this would happen? |
|
||||
|
I did that:
join -t: -1 3 -2 1 file1 file2 and if I hand type the files in - no problem. If however I use the original files with the differing separators, use sed to convert them to a ":" then the join fails. Same command, same file (except the separators in one have been manually entered, and the second time they were converted) different results sigh such a pita |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|