![]() |
|
|
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 |
| Merge files of differrent size with one field common in both files using awk | shashi1982 | Shell Programming and Scripting | 2 | 03-03-2009 07:12 AM |
| Merge two files whose names are given in other file | harshada | Shell Programming and Scripting | 1 | 10-01-2008 05:17 AM |
| MERGE 13 files and add the file name at the end of each record | vkr | Shell Programming and Scripting | 2 | 08-19-2008 12:57 PM |
| merge files | koti_rama | Shell Programming and Scripting | 5 | 12-24-2007 10:59 PM |
| merge two files in one file | nvkuriseti | Shell Programming and Scripting | 3 | 08-27-2007 07:06 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
merge two files into one file use awk
Hi, guys. I have one question:
I have two files: passwd and shadow (the number of records in these files are not equal)the contents of them are below: passwd: ************** ftp:x:24:24: sshd:x:71:65: uucp:x:10:14: brownj:x:5005:1000: sherrys: x :5006:1000: ... ************* passwd: ************** ... ftp:*:13503:: uucp:*:13503:: brownj:ASDFASERE#$#s:0:0 sherrys:GAS3434f#$#$@4:0:0 ... ***************** I want to merge them into a file or a variable called "join", which should have the following contents: *************** ... ftp:24:* uucp:10:* brownj:5005:ASDFASERE#$#s sherrys:5006:GAS3434f#$#$@4 ... *********************** How can I do this? Thank you very much for your time in advance -Keyang |
|
||||
|
Hi, fpmurphy.
Your code works, but it has a problem in my case, it always gives me 2 messages: join: File 1 is not in sorted order join: File 2 is not in sorted order Then I user sort command on both of them to get two new files, but still get these messages, do you know what might cause this problem? Thank you very much for your time in advance -Keyang |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|