You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Matt Benson <gu...@yahoo.com> on 2009/04/01 00:39:10 UTC

Re: Extracting information out of a file

I can't tell from your original post everything you intend to do with this information once you get it, but you may want to have a look at the <tokens> resource collection.

HTH,
Matt

--- On Tue, 3/31/09, Dylan Farre <dy...@gmail.com> wrote:

> From: Dylan Farre <dy...@gmail.com>
> Subject: Extracting information out of a file
> To: user@ant.apache.org
> Date: Tuesday, March 31, 2009, 7:50 AM
> 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.
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org