[REBOL] Re: Newbie: Grep question
From: brock:kalef:innovapost at: 13-Jul-2004 9:55
This may help you out a little - not the most efficient algorithm, but provides a very
simple little gui to select the directory to search. Also outputs a list of files found
as well as displaying the files as they are found in the console window.
rebol[]
; find only directory portion of path - exclude file name
data-src: request-file/only/title "Select any File from the Data Folder to Process" "Open"
data-src: first split-path data-src
result-list: copy []
find-text: request-text/default "Enter text to find"
change-dir data-src
files: read %.
print ["File containing: " :find-text newline]
foreach file files[
cnt: 0
data: read/lines file
foreach d data[
if all[find d find-text cnt = 0][
print [file "^-^-FOUND"]
append result-list file
cnt: cnt + 1
]
]
]
halt
Cheers,
Brock