Hi Keith,

> well i've looked at the parse section and can't quite figure it out...
> how do you nominate that you want the parse function to take place on a
> text file say "aeros.txt" rather than a string?

The parse function works on a string or on a block.

If you want to parse a file read the file into a string like this
   file-as-string: read %aeros.txt

or maybe (on windows)
  file-as-string: read %/c/autoexec.bat

If you want to parse a web based page you can do this
   web-page-as-string: read http://www.abc.net.au/news

Then you can
   parse file-as-string parse-rules

or
   parse web-page-as-string parse-rules

etc..

> and how do you specify it's location?
Refer to the user manual for the word READ and for accessing files.

> and how would you strip off just what's after the colon and discard what
is
> before the colon?

your-string: "FORM: Popular Recording"
parse your-string [
   SKIP THRU ":"
   COPY text
   [ TO newline | TO END ]
   (print text)
]

> when you parse files, can it be done on a folder of files?
> i have a stack of html files that i need to extract all text in a
> particular section and then change the table cells to tabs etc but i have
a
> few to do and would like to run the script over the whole lot at once if
> possible.

Use a loop. See the manual on looping.

> i can see no reference to how you parse files locally..there are only
> examples of web addresses or specifying a string.

The input data to parse must be a series! type. This series! can be either a
string! or a block!. So if you can make your data into a string or a block
you can use parse.

> thanks for your help

No Prob.
Brett.

Reply via email to