[REBOL] Re: Compose words to get content
From: compkarori:g:mail at: 5-Sep-2005 20:34
Hi Thorsten
Will this work for you?
foreach line sourcefile [
cells: parse/all line ","
foreach mline map [
write/append join tpath mline/1
rejoin [ pick cells to-integer mline/2 pick cells to-integer
mline/3 " " mline/4 " " newline ]
]
]
On 9/5/05, Thorsten Moeller <[tmoeller--fastmail--fm]> wrote:
> Hi,
>
> 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 have
> is when i want to compose the new lines from the rules. A little example
> should make it more clear:
>
> sourcefile: read/lines %/c/temp/sourcefile.txt
> tpath: %/c/temp/
>
> map: [ ["filename1.txt" "1" "8" "q"]
> ["filename2.txt" "1" "11" "m"]
> ["filename3.txt" "1" "27" "m"]
> ["filename4.txt" "1" "17" "q"]
> ]
>
> 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
> ]
>
--
Graham Chiu