Hi Thorsten

I didn't take the time to explain what was going wrong.

I think you were trying this ...

>> reduce [ join "cells/" "3" ]
=3D=3D ["cells/3"]

but reduce just evaluates that expression, and returns a string.

To evaluate the string as source code as you appeared to want, you
have to 'do it

reduce [ do join "cells/"  "3" ]

I just chose an alternate way of achieving the same end.


On 9/5/05, Thorsten Moeller <[EMAIL PROTECTED]> wrote:
>=20
> Hi Graham,
>=20
> thanks for your immediate help. It works as i need it. Thats the way i
> was searching for the whole yesterday evening. Perhaps it was to late
> and i do not have "pick" coming to my mind.
>=20
> Thanks
>=20
> Thorsten
>=20
>=20
> On Mon, 5 Sep 2005 20:34:09 +1200, "Graham Chiu" <[EMAIL PROTECTED]>
> said:
> >
> > Hi Thorsten
> >
> > Will this work for you?
> >
> > foreach line sourcefile [
> >    cells: parse/all line ","
> >    foreach mline map [=3D20
> >      write/append join tpath mline/1=3D20
> >      rejoin [ pick cells to-integer mline/2   pick cells to-integer
> > mline/3 " " mline/4 " " newline ]
> >  ]
> > ]
> >
> >
> > On 9/5/05, Thorsten Moeller <[EMAIL PROTECTED]> wrote:
> > >=3D20
> > > Hi,
> > >=3D20
> > > i made a small script to split a file. I use a series containing the
> > > rules how every row in the source should be splitted. The problem i h=
ave
> > > is when i want to compose the new lines from the rules. A little exam=
ple
> > > should make it more clear:
> > >=3D20
> > > sourcefile: read/lines %/c/temp/sourcefile.txt
> > > tpath: %/c/temp/
> > >=3D20
> > > map: [ ["filename1.txt" "1" "8" "q"]
> > > ["filename2.txt" "1" "11" "m"]
> > > ["filename3.txt" "1" "27" "m"]
> > > ["filename4.txt" "1" "17" "q"]
> > > ]
> > >=3D20
> > > foreach line sourcefile[
> > >     cells: parse/all line ","
> > >     foreach mline map [ write/append join tpath mline/1 reduce [join
> > >     "cells/" mline/2 join " cells/" mline/3 " " mline/4 " " newline ]=
];
> > >     -- Problem
> > > ]
> > >=3D20
> >
> > --=3D20
> > Graham Chiu
> > --
> > To unsubscribe from the list, just send an email to
> > lists at rebol.com with unsubscribe as the subject.
> >
>=20
> --
> http://www.fastmail.fm - A no graphics, no pop-ups email service
>=20
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>=20
>=20


--=20
Graham Chiu
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to