[ALLY] Parse Into?? Re:
[1/5] from: robert:muench:robertmuench at: 31-Jul-2000 10:40
> -----Original Message-----
> From: [greg_piney--mcgraw-hill--com] [mailto:[greg_piney--mcgraw-hill--com]]
<<quoted lines omitted: 4>>
> to read a line from a file and place each field in specific
> variables.
Hi, you can either build up a Rebol source code part, while parsing
and later execute it to get the variables into the global context. Or
you can create a rule, which creates variable names and directly
assign those name the values. It's not a missing feature of parse, you
have to dynamically create the code Rebol should execute to create the
variable/value pairs. Robert
[2/5] from: greg_piney:mcgraw-hill at: 31-Jul-2000 9:18
Hi All,
Is there a way in Rebol to "parse into". What I am trying to do is
to read a line from a file and place each field in specific variables.
Such as:
var1: field1
var3: field3
etc.etc.
With all Rebol's power, I cannot find a way to do this simply.
TIA,
Greg Piney
Standard and Poor's Web Engineering
[3/5] from: joel:neely:fedex at: 31-Jul-2000 16:39
Hi, Greg,
could you provide an example of what a line looks like?
-jn-
[greg_piney--mcgraw-hill--com] wrote:
[4/5] from: greg_piney:mcgraw-hill at: 31-Jul-2000 18:25
Joel,
Just a simple space-delimited config file
field1 field2 field3 field4 ......
the values should end up in:
var1 var2 var3 var4 .....
TIA,
Greg Piney
S&P Web Engineering
[joel--neely--fedex--com] on 07/31/2000 05:39:04 PM
Please respond to [ally--rebol--com]
To: [ally--rebol--com]
cc: (bcc: Greg Piney/McGraw-Hill/US)
Subject: [ALLY] Parse Into?? Re:
Hi, Greg,
could you provide an example of what a line looks like?
-jn-
[greg_piney--mcgraw-hill--com] wrote:
[5/5] from: joel:neely:fedex at: 1-Aug-2000 9:36
In that case...
>> set [var1 var2 var3 var4] parse {field1 field2 field3 field4} none
== ["field1" "field2" "field3" "field4"]
>> var1
== "field1"
>> var2
== "field2"
>> var3
== "field3"
>> var4
== "field4"
>>
-jn-
[greg_piney--mcgraw-hill--com] wrote:
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted