ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Extracting key,value from a property
Date Mon, 05 Jul 2004 05:45:39 GMT
If you only want to have the properties loaded simply use <property
file=""/>.

If you want to access the "AuthorAddressEntityBean" as ${key} simply split
the 
value.
- using AntContribs <propertyregexp>
- using <script> and java.lang.String.split()

Jan

> -----Urspr√ľngliche Nachricht-----
> Von: MCG QA [mailto:mcgqa@yahoo.com]
> Gesendet am: Freitag, 2. Juli 2004 23:49
> An: Ant Users List
> Betreff: Extracting key,value from a property
> 
> I have a property file env.txt which contains values
> as under:
> 
> AuthorAddressEntityBean=c:/temp
> AuthorDetailsSessionBean=c:/bea
> AuthorEntityBean=c:/b-copy
> AuthorXrefEntityBean=c:/WEB-INF
> BindingXref=c:/PVCS
> BiographiesSessionBean=c:/mhhe-build
> CommonSessionBean=c:/qalogs
> CompetCategorySessionBean=c:/qalogs/mhhe
> 
> I'm using <foreach> task and set it as a property  as
> under:
> 
> <foreach list="${environments}" delimiter="&#x0A;"
> param="CurEnv" target="loop-target"/>
> 
> 
> And when I execute this task, which is basically an
> echo at this moment, I would get the following values
> for Curenv for each iteration/line:
> Curenv:AuthorAddressEntityBean=c:/temp
> Curenv:AuthorDetailsSessionBean=c:/bea
> Curenv:AuthorEntityBean=c:/b-copy
> etc...
> 
> What I would like to do is to extract each of the
> above as both key and value, into two separate
> variables.
> 
> for example, my <foreach> task would return me a
> property "AuthorAddressEntityBean=c:/temp"
> 
> I would like to extract from this property the
> following: 
> "key" = AuthorAddressEntityBean
> "value" = c:/temp 
> in this case.
> 
> How can I do this?
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message