![]() |
|
|
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 |
| awk, join or sed | jkl_jkl | Shell Programming and Scripting | 1 | 04-15-2008 06:55 AM |
| Join | jazz8146 | UNIX for Dummies Questions & Answers | 5 | 01-29-2008 11:42 AM |
| join (pls help on join command) | summer_cherry | Shell Programming and Scripting | 1 | 12-31-2007 05:19 AM |
| Join Files | choppas | Shell Programming and Scripting | 2 | 10-18-2006 11:03 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
A join problem?
Hi everybody, I am hoping somebody here will be either be able to solve my troubles or at least give me a push in the right direction .I am developing a shell script to read in 4 different files worth of data that each contain a list of: username firstname secondname group score I have got my script sorting the files into a final file with the format username firstname secondname group score score score score I have a solution to do this working fine using join until I get one situation. The names listed do not appear in all files and I need to put 0 in for the score when the name is missing. But join is making firstname, secondname and group become 0's too if the person is missing in any file but the last. The current code im using is: Code:
join -a 1 -a 2 -o 0 2.2 2.3 2.4 1.5 2.5 -e "0" ass1.$$ ass2.$$ |
join -a 1 -a 2 -o 0 2.2 2.3 2.4 2.5 1.5 1.6 2.5 -e "0" - ass3.$$ |
join -a 1 -a 2 -o 0 2.2 2.3 2.4 1.5 1.6 1.7 2.5 -e "0" - ass4.$$ > sorted.$$
How can i solve this? I have tried searching Google and have spent time looking through many examples. Just with no similar solution to what i am looking for. Thank you for your help in advance. Jamie |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|