Hi -

you might try the following snippet for reading values on a line in a
file...

linefile: read/lines %lines.txt

foreach line linefile [
 print line
]

Replace "print line" with with whatever you want to use, line should have
the value you want to use for whatever.

- Porter

----- Original Message -----
From: "mechtn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 15, 2001 1:54 PM
Subject: [REBOL]


>
> Can anyone tell me how I would make this program read each line from
test.txt and make them a variable. For instance if test.txt had the
following values on each line.
>
> o40_1955
> o40_1996
> o40_1997
> o40_1998
>
> How could I make the read/lines put that into a variable. Like just keep
reading and making new variables till it hits the end of the file or 30
variables whichever comes first. Thanks guys for all your help!
>
> rebol
>  [
>    Title:   "Read lines from txt file"
>    Author:  "Koie Smith"
>    Date:    15-Oct-2001
>    File:    %koie1.r
>    Purpose: {
>         Read lines from a txt file and set them as variables.
>     }
>
>
>  ]
>
> print read/lines %/c/rebol/test.txt
>
> halt
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to