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: Open and read file with ant and then copy
Date Mon, 10 Sep 2007 09:52:45 GMT
Just an idea and not tested. Use '=' for separating source from target name. Used AntContrib.

copy.txt
--------
/a/b/c.xml=/d/e/f.xml
...



<loadfile property="allfiles" file="copy.txt"/>
<ac:for list="${allfiles}" param="line">
    <sequential>
        <ac:propertyregex property="from" input="@{file}" regexp="(.*)=(.*)" select="\1"
override="true"/>                   
        <ac:propertyregex property="to"   input="@{file}" regexp="(.*)=(.*)" select="\2"
override="true"/>
        <copy file="${from}" tofile="${to}"/>
    </>
</>



Jan


>-----Urspr√ľngliche Nachricht-----
>Von: Mitja B. [mailto:info@mitjab.com] 
>Gesendet: Montag, 10. September 2007 10:32
>An: Materne, Jan (RZF)
>Betreff: Re: AW: Open and read file with ant and then copy
>
>We have few different customers which all have uniq files to 
>copy. We want
>that if is possible ant read project.txt file and in it are 
>all relative
>paths for files to copy, then ant will copy all this files.
>
>Is this possible?
>
>
>--------- Original Message --------
>From: Jan.Materne@rzf.fin-nrw.de
>To: user@ant.apache.org <user@ant.apache.org>, info@mitjab.com
><info@mitjab.com>
>Subject: AW: Open and read file with ant and then copy
>Date: 10/09/07 09:49
>
>> What is the use case for using this project.txt?
>> 
>> Usually you copy a bunch of files with &lt;copy todir&gt;&lt;fileset
>dir=&quot;from&quot;&gt;
>> 
>> 
>> Jan 
>> 
>> &gt;-----Urspr√ľngliche Nachricht-----
>> &gt;Von: Mitja B. [mailto:info@mitjab.com] 
>> &gt;Gesendet: Montag, 10. September 2007 09:29
>> &gt;An: user@ant.apache.org
>> &gt;Betreff: Open and read file with ant and then copy
>> &gt;
>> &gt;I have big problem. I search but can not find and solution.
>> &gt;
>> &gt;We want to open some file, for example project.txt
>> &gt;
>> &gt;in it we will have content like this
>> &gt;
>> &gt;instmmconnection.xml projrtuconnection.xml
>> &gt;
>> &gt;we want now that ant read this file and copy connectiion.xml 
>> &gt;from instmm
>> &gt;directory to projrtu directory
>> &gt;
>> &gt;How can we do this with ant, or even better is this possible?
>> &gt;
>> &gt;Thx
>> &gt;
>> &gt;________________________________________________
>> &gt;Message sent using UebiMiau 2.7.10
>> &gt;
>> &gt;
>> &gt;
>> 
>&gt;-----------------------------------------------------------
>----------
>> &gt;To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> &gt;For additional commands, e-mail: user-help@ant.apache.org
>> &gt;
>> &gt;
>> 
>> 
>
>________________________________________________
>Message sent using UebiMiau 2.7.10
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message