Hi,

Actually, I just tried the following:

>> blk: {String 1,"String, 2",string 3}
== {String 1,"String, 2",string 3}
>> set [var1 var2 var3] parse/all blk ","
== ["String 1" "String, 2" "string 3"]
>>

Apparently, REBOL's 'parse word does a little extra here with embedded
commas in quoted strings. It appears to work with other separator characters
also.

Regards,


Bernie Schneider
Systems Analyst
CIBER, Inc.
303-224-4159
[EMAIL PROTECTED]

> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, December 01, 1999 10:40 AM
> To:   [EMAIL PROTECTED]
> Subject:      [REBOL] 1000's of objects's in array - Works fine for  me...
> Re:(3)
> 
> At 10:47 AM 12/1/99 -0500, you wrote:
> >
> >
> >Please elaborate on this for process
> > to handle standard comma delimited files (or tab delimited files)...
> 
> set [ x1 x2 x3 ... ] parse record ","
> 
> This presupposes that there are no commas contained in the fields. If you
> may encounter fields that will include commas, were commas are not field
> delimiters, usually I'd expect they occur in quoted strings:
> 
> "field-with-comma, something", "another field"
> 
> and the parse will be a little more complicated.
> 
> Elan
> 
> >
> >Any more pointers on the words  set [ x1 x2 x3 x4 ... ] record
> >
> >I know about "set"  , but what is "record".... is that a word or just
> your
> >example value.
> >
> 
> my guess is you're right, record indeed is an example, supposedly a string
> that contains the contents of your comma delimited file, i.e. record: read
> %commada-delimited-file.dat
> 
> Elan
> 
> >
> >
> >
> >
> >From: [EMAIL PROTECTED] on 12/01/99 03:46 AM GMT
> >
> >
> >
> >Please respond to [EMAIL PROTECTED]
> >
> >
> >
> >To:   [EMAIL PROTECTED]
> >cc:    (bcc: Doug Vos)
> >Subject:  [REBOL] 1000's of objects's in array - Works find for me... Re:
> >
> >
> >
> >
> >And, if each record is identical, then you can skip the objects
> altogether.
> >Instead, just map the record to variables as you need:
> >
> >   set [field1 field2 field3 ...] record
> >
> >Saves a lot of mem space....
> >
> >-Carl
> >
> >
> >At 11/30/99 04:34 PM -0500, you wrote:
> >>
> >>
> >>If you are talking simple objects - no embedded functions (in each
> object).
> >>
> >>I have scripts that do that every day with thousands of objects in a
> >>block/series.
> >>
> >>I read in a flatfile database with about  16 fields and 1900 records...
> >>converting to objects as I parse the data.
> >>
> >>Works great.
> >>
> >>So, my suggestion would be to just try it and see how large it will
> scale
> >>before you think it won't work.
> >>
> >>- doug
> >>
> >
> >
> >
> >
> >
> >

Reply via email to