![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Directory sizes loop optimization | la_womn | Shell Programming and Scripting | 6 | 05-16-2008 11:05 PM |
| On Premature Optimization | iBot | Complex Event Processing RSS News | 0 | 02-12-2008 05:20 AM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 03:06 AM |
| Program crashes with optimization level O2 | Yuriy07 | HP-UX | 3 | 08-17-2007 01:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help on optimization of the script
Hi,
I have prepared script which is taking more time to process. find below script and help me with fast optimized script:- cat name.txt | while read line do name=$(echo $line| awk '{print $8}') MatchRecord=$(grep $name abc.txt | grep -v grep ) echo "$line | $MatchRecord" | awk -F"|" ' BEGIN { format = "%-6s %-10s %-10s %-4s %-19s %-6s %-2s %-6s %-4s\n" } { split($1, rsp," ") split($2, req," ") printf format, req[1], rsp[2], rsp[3], rsp[4], req[5], rsp[6], rsp[7], rsp[8], rsp[9] }' done >> /tmp/new.txt |
|
||||
|
Thanks for quick reply
name.txt ...... 12345 67890 0000 ................... ...... 00 12345 2131 abc.txt 111111 12345 67890 0000 1234567890 12345 dfadsf in both file 8th field is common. using common field i want to fill the blank fileds in name.txt for this value will be taken from abc.txt |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|