You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dylan Farre <dy...@gmail.com> on 2009/03/31 14:50:42 UTC

Extracting information out of a file

I am looking for a generic way (Ant task) to extract information out of a
file. For example I have a sql script that calls other sql scripts. I want
to be able to extract the list of these sub scripts. It would be great if
the task would put them in an AntXtras strings type contruct, or something
equivalent (AntContrib maybe?). Ideally, this task would allow me to use
regex pattern matching for the start and end tokens of the data I want to
extract.

For example sql_main.sql:

...
connect &&user/&&pass@&&db start &&db.sub_1.sql
....

I would want to dynamically get the c_d_trig.sql put into a AntXtras strings
or equivalent, by specifying the start token as ".*&&db." or even just "."
and the end token as "&#xD;&#xA;"

Any help will be appreciated.
P.S. If no one can help, I'll try the AntXtras forum. Is there a separate
forum for Ant-Contrib?
Thanks.