[REBOL] Re: Newbie parsing problem (cont'd)
From: joel:neely:fedex at: 29-Mar-2002 17:04
Hi, again, Richard,
COFFRE Richard FTO wrote:
> Hi,
>
> I have a file containing data as below :
>
> GetActiveAccounts:request = activeaccounts
> GetTransactions:request = ocodereview
> CancelAccount:request = cancelacc
>
> In my code, I try to catch everything before ":request"
> with the following
> instructions :
>
>> sample: {
{ GetActiveAccounts:request = activeaccounts
{ GetTransactions:request = ocodereview
{ CancelAccount:request = cancelacc
{
{ }
== {
GetActiveAccounts:request = activeaccounts
GetTransactions:request = ocodereview
CancelAccount:request = cancelacc
}
>> foreach line parse/all sample "^/" [
[ prefix: none parse/all line [copy prefix to ":request"]
[ if prefix [print prefix]
[ ]
GetActiveAccounts
GetTransactions
CancelAccount
-jn-
--
; Joel Neely joeldotneelyatfedexdotcom
REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip
do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] {
| e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]