[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading through files
>Date: Mon, 19 Jun 1995 14:57:01 -0400
>From: "Gregory L. Snead" <gsnead@harlequin.com>
> I'm missing something conceptually. I have a file that I want
>to read through one line at a time and perform some type of
>operation in es using the data read in. I've read through
>the man page a couple of times and I don't see how I can do this.
>What am I missing? How do I do this?
Although the on-line manual gives you everything you need, some
synthesis must be done to put the pieces together. Here is a
quick example:
for (i= `` \n {cat /etc/passwd}) # in turn, i is assigned each line from file
{j= <={%fsplit : $i}; # i is broken down into fields in temp j
echo $j(1)} # the symbolic user id is printed for line i
See on-line es manual for details on
%fsplit,
`` ifs-list { command },
and for (var = list) command
--
Loren J. Rittle (rittle@comm.mot.com) Ripem-1.2 MD5OfPublicKey:
Systems Technology Research (IL02/2240) D2CE4A0F2BABF33AEF10C8C669DD782D
Motorola, Inc. PGP-2.6 Key fingerprint:
(708) 576-7794 6810D8AB3029874DD7065BC52067EAFD