You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by MCG QA <mc...@yahoo.com> on 2004/07/02 23:48:44 UTC

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