07-17-2009, 08:35 AM
hello,
i can't find a grep function to extract line text conatining a pattern and the line number
file to test :
myfile.txt
I like one
i like two
i like three
i like four
i acheive that doing
str match Fichier.getfile(myfile.txt)
ARRAY(str) toto
toto=Fichier
for int'i 0 toto.len
if(findrx(toto[i] "like" 0 1 match)<0) continue
else
out "the line containing ''like'' is %s" toto[i]
out "the number of the line is %i" i
Anyway simplier?
i can't find a grep function to extract line text conatining a pattern and the line number
file to test :
myfile.txt
I like one
i like two
i like three
i like four
i acheive that doing
str match Fichier.getfile(myfile.txt)
ARRAY(str) toto
toto=Fichier
for int'i 0 toto.len
if(findrx(toto[i] "like" 0 1 match)<0) continue
else
out "the line containing ''like'' is %s" toto[i]
out "the number of the line is %i" i
Anyway simplier?