[REBOL] Re: Read question in Reb 3.0
From: raimunddold::web::de at: 16-Feb-2009 18:19
Am Samstag 14 Februar 2009 schrieb Robert M. M=FCnch:
> Am 14.02.2009, 11:11 Uhr, schrieb Raimund Dold <raimunddold-web.de>:
> > maybe I did not find the answer in the docs, but anyway.
> >
> > In R2.0 I regularly used something like read/lines %myfile.txt to read a
> > file and get the single lines. How I am supposed to do this in R3?
>
> Hi, because R3 supports unicode and unicode can be encoded in different
> ways, you know have to specify a "format" you want the data to be loaded.
> Try:
>
> deline to-string read %myfile.txt
>
Hi,
I tried your suggestion but does not provide what I wanted.
I have a file lines.txt with the following contents:
line 1
line 2
line 3
line 4
line 5
Doing the following in R3:
>> dat: deline to-string read %lines.txt
== {line 1
line 2
line 3
line 4
line 5
}
>> length? dat
== 35
Which shows clearly, that I do not get what read/lines %lines.txt did in R2=2E
If I even omit the deline I get the identical results. For me deline seems to
be only useful if I get a file from a different platform.
Any more suggestions for the read/lines replacement in R3??
Raimund