Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grep function?
#1
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?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)