![]() |
|
|
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 |
| How to combine 2 different files | rdasari | HP-UX | 1 | 03-17-2008 05:19 PM |
| combine two files | fredao1 | Shell Programming and Scripting | 1 | 01-08-2007 09:29 PM |
| Combine 2 files | Nekki | UNIX for Dummies Questions & Answers | 2 | 12-01-2005 02:46 AM |
| How to combine 2 files | ravi.sadani19 | Shell Programming and Scripting | 2 | 07-12-2005 05:04 AM |
| how to combine two files | tao | UNIX for Dummies Questions & Answers | 4 | 03-21-2002 10:38 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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? |
|
||||
|
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> |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|