Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Compose words to get content

 [1/5] from: tmoeller:fastmail:fm at: 5-Sep-2005 9:49


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 ] The problem i could not get rid off, is that i get an error saying cells/1 has no value . It is composed correctly but cannot be evaluated. So, why can the content of cells not be acessed. I tried every combination coming to my mind, but nothing worked. Please help! Thanks Thorsten -- http://www.fastmail.fm - Send your email first class

 [2/5] from: compkarori:gmai:l 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
<<quoted lines omitted: 14>>
> -- Problem > ]
-- Graham Chiu

 [3/5] from: tmoeller:fastmail:fm at: 5-Sep-2005 10:51


Hi Graham, 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. Thanks Thorsten On Mon, 5 Sep 2005 20:34:09 +1200, "Graham Chiu" <[compkarori--gmail--com]> said:
> Hi Thorsten > Will this work for you?
<<quoted lines omitted: 36>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- http://www.fastmail.fm - A no graphics, no pop-ups email service

 [4/5] from: compkarori::gmail::com at: 5-Sep-2005 21:29


Hi Thorsten I didn't take the time to explain what was going wrong. I think you were trying this ...
>> reduce [ join "cells/" "3" ]
== ["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 <[tmoeller--fastmail--fm]> wrote:
> Hi Graham, > thanks for your immediate help. It works as i need it. Thats the way i
<<quoted lines omitted: 56>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- Graham Chiu

 [5/5] from: tmoeller::fastmail::fm at: 5-Sep-2005 12:16


Hi Graham, thanks for spending some extra light on this issue. Nice to see that i wasn't totally on the wrong track. Thorsten On Mon, 5 Sep 2005 21:29:56 +1200, "Graham Chiu" <[compkarori--gmail--com]> said:
> Hi Thorsten > I didn't take the time to explain what was going wrong.
<<quoted lines omitted: 85>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
------ Thorsten Moeller Schwalbenweg 5a 22453 Hamburg Fon: 040 / 589 17 980 Mobil: 0171 / 490 33 59 Mail: [tmoeller--fastmail--fm] -- http://www.fastmail.fm - Does exactly what it says on the tin

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted