Re: Reading Variables

From: Robbie Clark (rclark_at_getnetworked.com)
Date: 05/05/03


Date: Mon, 5 May 2003 10:48:43 -0500

I guess I'm lost. I've never used read to pull from a data file. (only to
get keyboard input).
I tried
read var1 var2 < data.file
and got the data fields from the first record fine.
How do I go to the next record to get r2d1 and r2d2 into var1 and var2?

Thanks,

<joe@invalid.address> wrote in message
news:m3llxlo2ut.fsf@invalid.address...
> "Robbie Clark" <rclark@getnetworked.com> writes:
>
> > Another newbie question. . . .
> > Is it possible to read variables from a data file into a shell script?
> > (linux bash)
> > I'd like to loop through a data file structured as such . .
> > r1d1 r1d2
> > r2d1 r2d2
> > r3d1 r3d2
>
> > I'd like to pull in r1d1 and r1d2 into separate variables, then loop
> > again to pull r2d1 and r2d2 (no punn intended) into the same
> > variables, and so on until the end of the data file.
>
> Use read, it does field splitting for you.
>
> Joe



Relevant Pages

  • Re: VMS support but Iget this error
    ... The main point here is that the program posted here in this newsgroup is essentially for a database and database format that no longer exist. ... So the main program logic needs to be re-done because the data file is now a flat file. ... The locations of data fields, reports may also have to be re-done. ...
    (comp.lang.fortran)
  • PivotTable - show top items
    ... I use the data file from the above site. ... My interpretation is that we can only show top items on data fields and they must be in the data area. ... Epinn ...
    (microsoft.public.excel.newusers)