![]() |
|
|
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 |
| compare files | antointoronto | Shell Programming and Scripting | 8 | 06-24-2008 06:13 PM |
| compare files | prashanth.spl | Shell Programming and Scripting | 0 | 06-18-2008 05:22 PM |
| Compare & replace contents within a file | kaustubh137 | Shell Programming and Scripting | 2 | 05-27-2008 07:56 AM |
| compare files | spt | Shell Programming and Scripting | 1 | 05-09-2008 11:57 AM |
| compare files | ingunix | UNIX for Dummies Questions & Answers | 3 | 05-24-2001 12:44 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
compare 2 files and replace
Hi,
I have a file which contains names with counts for eg: 0622 0031 JOHN MAX 20080622003104. STAT 1. 0622 0031 BILL MAX 20080622003104. STAT 7. and I have an exception file containing. BILL Can anyone help to write a script using this exception files to replace the STAT *(could be any number) to STAT 0 for the names that are in this list the output should be and the format remains the same 0622 0031 JOHN MAX 20080622003104. STAT 0. any comments or help appriciated. I got a script which can do this, but it changes the format. #!/usr/bin/ksh nawk ' FNR==NR {ex[$1]; next} { $9 = ($1 in ex) ? "0." : $2; print } ' a2 a1 > a3 any help appriciated. thanks Last edited by antointoronto; 06-25-2008 at 01:32 AM.. |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|