Donna Garverick wrote:
> i've got a simple little text file with two pieces of
> information on each record. the first 'word' (piece of
> information) could be considered as a key value. that is --
> another process will be examining this file looking for a
> match on the first field. (and btw, since i know the
> data....most of the time the match will fail....). if a
> match is found, i need the 2nd 'word' (piece of information)
> placed into a ci variable. sound rather simple....except
> that last piece -- getting the information from the file
> into a variable.
The POSIX join program might be useful here; see "man join" for details:
INVENT3K:/BIXBY/PUB/demo/join$ cat datafile
1 one
2 two
3 three
INVENT3K:/BIXBY/PUB/demo/join$ cat doit
#!/bin/sh
KEY=2
callci setvar value "'$(echo $KEY | join -o 2.2 - datafile)'"
callci showvar value
INVENT3K:/BIXBY/PUB/demo/join$ doit
VALUE = two
--
[log in to unmask]
Remainder of .sig suppressed to conserve scarce California electrons...
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *