HP3000-L Archives

October 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Campbell Fethers <[log in to unmask]>
Reply To:
Campbell Fethers <[log in to unmask]>
Date:
Tue, 23 Oct 2001 16:35:44 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (37 lines)
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.
>

awk is cool, but here is an non-posix solution:

setvar keyval,"whatever"
file x=input file
comment Output file must be same record type as input file
file y=$newpass ;rec=-80,,f,ascii ;nocctl
run fcopy.pub.sys ;info='from=x ;to=*y ;subset="!keyval",1'
reset x
file y=$oldpass
if finfo("*y","eof") > 0
  input tgtval<*y
  setvar tgtval,rht(tgtval,-len(keyval)-1)
  showvar tgtval
endif
reset y


HTH
Campbell Fethers

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2