Ron Wuerth wrote:
> Okay Donna,
drum roll, please :-)
> Here's the awk solution
> (thanks again Ken, Jeff & Mark)
(absolutely!)
> KEYVAL is real simple
>
> PARM key=0
> SETVAR KEYVAL 0 #just for testing can get rid of it
> SHOWVAR KEYVAL #just for testing can get rid of it
> /bin/awk "-f KVAWK amatch=!key" < DATAFILE
> SHOWVAR KEYVAL #just for testing can get rid of it
'amatch'?? (where is that in o'reilly's unix cd? i can't find
it....)
> Here is KVAWK
>
> { key[++j]=$1; val[j]=$2; }
> END {
> for(i in key) {
> if (key[i]==amatch) {
> system("callci SETVAR KEYVAL \\'"val[i]"\\'");
> }
> }
> }
ok....i'm lost. in the first script you're passing in(??)
amatch...then why is it in the awk 'program'?
> HTH
it sure does. thank you!! - d
--
Donna Garverick Sr. System Programmer
925-210-6631 [log in to unmask]
>>>MY opinions, not Longs Drug Stores'<<<
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *