FYI, The following worked great! The <for> task uses the macrodev, therefore
is hundreds of times faster than the <foreach> task. The <propertyregx> task
can parse anything your little heart desires!
<target name="test4">
<for param="current.file">
<path>
<fileset dir="${web.content.dir}" />
</path>
<sequential>
<echo message="processing file, @{current.file}" />
<propertyregex property="partial.file.name"
input=" @{current.file}
regexp="Web Content\\([^*]*).*"
select="\1"
override="yes"
casesensitive="false" />
<echo message="partial file name, ${partial.file.name}" />
</sequential>
</for>
</target>
The above code outputs the following;
[echo] processing file, C:\_project\eclipse\flex\Web
Content\META-INF\MANIFEST.MF
[echo] partial file name, META-INF\MANIFEST.MF
[echo] processing file, C:\_project\eclipse\flex\Web
Content\WEB-INF\classes\JustToMakeTheFolderStay.class
[echo] partial file name, WEB-INF\classes\JustToMakeTheFolderStay.class
Now I can use the partial file name to construct the paths I need.
Gary
-----Original Message-----
From: Gary Eberhart [mailto:gary@cmcflex.com]
Sent: Thursday, June 03, 2004 1:53 PM
To: Ant User's List (E-mail)
Subject: Parsing Properties
Hello All,
I need to get a sub string of a path to use in building another path.
>From this string,
C:\_project\eclipse\flex\Web Content\flexgui\flexgui.jnlp
I need to create this string,
flextemp\localchecksums\flexgui\flexgui.jnlp.MD5
and this string,
flextemp\remotechecksums\flexgui\flexgui.jnlp.MD5
Is there any easy way to do this?
Gary Eberhart
Manager New Product Development
Computer Marketing Corporation
Phone: 801-365-5000
Fax: 801-365-5100
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
|