![]() |
|
|
|
|
|||||||
| 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 |
| How to combine 2 different files | rdasari | HP-UX | 1 | 03-17-2008 01:19 PM |
| combine two files | fredao1 | Shell Programming and Scripting | 1 | 01-08-2007 05:29 PM |
| Combine 2 files | Nekki | UNIX for Dummies Questions & Answers | 2 | 11-30-2005 10:46 PM |
| How to combine 2 files | ravi.sadani19 | Shell Programming and Scripting | 2 | 07-12-2005 01:04 AM |
| how to combine two files | tao | UNIX for Dummies Questions & Answers | 4 | 03-21-2002 06:38 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Need To Combine 2 Files
I have 2 files that I need to combine.
One file is looks like this: 71664107;1;1;05-FEB-07;12-FEB-07; The other file looks like this: U;71664107;dummy;Pirovano;M;04-SEP-75;Georgia;MI;1;1;31;S;S;;;Y;05-02-2007;0;12-FEB-07; I need to combine both files together. I need the shorter file added to the end of the longer file based on the common # 71664107. I have tried using get line but sometimes it does not work. Any suggestions? |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
U;71664107;dummy;Pirovano;M;04-SEP-75;Georgia;MI;1;1;31;S;S;;;Y;05-02-2007;0;12-FEB-07; So you might be able to use: nawk 'BEGIN { FS=";" } { print $0 $2";"$9";"$10";"$17";"$19";" }' <longfile> |