I use your idea but i still have small problem. I install Ant-Contrib Tasks
but still get this error. I little modify your code
OUTPUT =
c:\Projekti\test>ant opencopy
Buildfile: build.xml
opencopy:
BUILD FAILE:
c:\projekti\test\build.xml:19: The following error occurred while executing
this line: C:\projekti\test\build.xml:23: Warning: could not find file
c:\Projekti\test\${from} to copy
Total time: 0 seconds
:: line 19 is <ac:for
:: line 23 is <copy
CODE =
<target name="opencopy">
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<loadfile property="allfiles" srcFile="c:/Projekti/test/message.txt"/>
<ac:for list="${allfiles}" param="line">
<ac:sequential>
<ac:propertyregex property="from" input="@{srcFile}" regexp="(.*)=(.*)"
select="\1" override="true"/>
<ac:propertyregex property="to" input="@{srcFile}" regexp="(.*)=(.*)"
select="\2" override="true"/>
<copy file="${from}" tofile="${to}"/>
</ac:sequential>
</ac:for>
</target>
this is message.txt
/a/b/c.xml=/d/e/f.xml
--------- Original Message --------
From: Ant Users List <[email protected]>
To: [email protected] <[email protected]>
Subject: AW: Open and read file with ant and then copy
Date: 10/09/07 11:53
> 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:[EMAIL PROTECTED]
> >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: [EMAIL PROTECTED]
> >To: [email protected] <[email protected]>, [EMAIL PROTECTED]
> ><[EMAIL PROTECTED]>
> >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:[EMAIL PROTECTED]
> >> &gt;Gesendet: Montag, 10. September 2007 09:29
> >> &gt;An: [email protected]
> >> &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: [EMAIL PROTECTED]
> >> &gt;For additional commands, e-mail: [EMAIL PROTECTED]
> >> &gt;
> >> &gt;
> >>
> >>
> >
> >________________________________________________
> >Message sent using UebiMiau 2.7.10
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
________________________________________________
Message sent using UebiMiau 2.7.10
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]