Thanks a lot David!

I succeeded by doing this:
<loadfile property="modbasedir" srcFile="xyz">
        <filterchain>
                <expandproperties/>
                <replacestring from="\" to="/"/>
                <replacestring from=":" to=""/>
                <replacestring from=" " to="\ "/>
        </filterchain>
</loadfile>

My original path is inside the property "basedir" while the file "xyz"
contains the string "${basedir}". Thus I get my original path by using
"<expandproperties/>".
(My modified path is inside the property "modbasedir".)

Is there a way not to be in need of the file "xyz"? AFAIK all commands
that support a filterchain are working on files rather than just properties.

Cheers,
Nicolai

On 16.11.2007, at 05:45, David Weintraub wrote:

A little tired right now to test it, but you could use a filter in a
copy. See these pages:

<http://ant.apache.org/manual/CoreTypes/filterchain.html>
<http://ant.apache.org/manual/CoreTypes/ filterchain.html#replacestring>

On Nov 15, 2007 1:32 PM, Nicolai Kamenzky <[EMAIL PROTECTED] berlin.de> wrote:
Hi folks!

I have a property which contains a path "C:\Documents and Settings
\..." and I have to convert it to this format "c/Documents\ and\
Settings/...". Thus I have to replace "\" with "/" and so on.

How do I do this? I can access my property with ${myProperty} and
want to get another property with the replaced chars.

Cheers,
Nicolai

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
--
David Weintraub
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to