Newbie parsing problem
[1/4] from: pyxos::netcourrier::com at: 29-Mar-2002 10:53
Hi,
I would like to extract all the lines containing the string call and write them with
a newline.
I have the following code, but nothing happens, what's wrong ?
REBOL =5B=5D
texte: read/lines %generic4.txt
foreach ligne texte
=5B
if parse/all texte =5B =22call=22 =5D
=5B
write/append %calls.txt ligne
=5D
=5D
Thanks in advance
-------------------------------------------------
=22Sound Mind, Sound Body=22 Juv=E9nal
=22Lire et =EAtre curieux, c'est la m=EAme chose=22 Pascal Quignard
=22Qui triomphe de lui-m=EAme poss=E8de la force=22 Lao-Tseu, extrait du Tao Te King
=22Dans la course =E0 la qualit=E9, il n'y a pas de ligne d'arriv=E9e=22 David Kearns
Allez voir mon site : http://www.desala.org
-------------------------------------------------------------
NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar...
Web/Wap : www.netcourrier.com
T=E9l=E9phone/Fax : 08 92 69 00 21 (0,34 =80 TTC/min)
Minitel: 3615 NETCOURRIER (0,15 =80 TTC/min)
[2/4] from: rebol665:ifrance at: 29-Mar-2002 12:30
Hi Richard
Try [thru "call" to end] like this.
texte: ["without the text" "with call inside" "with call" "without it"]
foreach ligne texte [
if parse/all ligne [ thru "call" to end ][
print ligne
]
]
HTH
Patrick
----- Original Message -----
From: "Richard Coffre" <[pyxos--netcourrier--com]>
To: <[rebol-list--rebol--com]>
Sent: Friday, March 29, 2002 10:53 AM
Subject: [REBOL] Newbie parsing problem
Hi,
I would like to extract all the lines containing the string call and write
them with a newline.
I have the following code, but nothing happens, what's wrong ?
REBOL []
texte: read/lines %generic4.txt
foreach ligne texte
[
if parse/all texte [ "call" ]
[
write/append %calls.txt ligne
]
]
Thanks in advance
-------------------------------------------------
Sound Mind, Sound Body
Juvénal
Lire et être curieux, c'est la même chose
Pascal Quignard
Qui triomphe de lui-même possède la force
Lao-Tseu, extrait du Tao Te King
Dans la course à la qualité, il n'y a pas de ligne d'arrivée
David Kearns
Allez voir mon site : http://www.desala.org
-------------------------------------------------------------
NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs,
Toolbar...
Web/Wap : www.netcourrier.com
Téléphone/Fax : 08 92 69 00 21 (0,34 ? TTC/min)
Minitel: 3615 NETCOURRIER (0,15 ? TTC/min)
[3/4] from: greggirwin:mindspring at: 29-Mar-2002 12:17
Hi Richard,
<< I would like to extract all the lines containing the string call and
write them with a newline. >>
I'm not sure of your exact needs, but you might also be able to use FIND
instead of PARSE.
--Gregg
[4/4] from: joel:neely:fedex at: 29-Mar-2002 16:58
Hi, Richard,
Richard Coffre wrote:
> Hi,
>
> I would like to extract all the lines containing the string
> call and write them with a newline.
>
>> stuff: [
[ "I don't know what to call this block."
[ "Therefore it has no name."
[ "I cannot call it Change because."
[ "It would not be the Same."
[ ]
== [
"I don't know what to call this block."
"Therefore it has no name."
"I cannot call it Change because."
"It ...
>> foreach line stuff [if found? find line "call" [print line]]
I don't know what to call this block.
I cannot call it Change because.
-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 ]