ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: getting properties by pattern.
Date Thu, 17 Apr 2003 14:05:19 GMT
Not sure what you intend to do with them, but you
could probably use a number of tasks to accomplish
this:

<echoproperties destfile="somefile.properties" />

<loadfile srcFile="somefile.properties"
property="dirbranchprops">
  <filterchain>
    <linecontainsregexp>
      <regexp pattern="^dir.branch." />
    </linecontainsregexp>
  </filterchain>
</loadfile>


To be 100% proper, you'd have to escape the dots--I
can't remember the exact proper way to do it now (sue
me).  If you just want the names you could run your
temp file through a replaceregexp:

<replaceregexp file="somefile.properties"
 match="=*$" replace="" byline="true"/>

-Matt


--- P Dunham <pcdunham_ng@hotmail.com> wrote:
> Hi all,
> 
> Is there any way to get properties without knowing
> their full name?
> 
> For example if I have an unknown number of
> properties in my build.properties
> file similar to:
> 
> dir.branch.web
> 
> dir.branch.util
> 
> etc.
> 
>  
> 
> is there a way to get all properties beginning with
> dir.branch.*  ?
> 
>  
> 
> Thanks,
> 
> -Philip
> 
> 


__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

Mime
View raw message