Thanks! Works great!


Rebhan, Gilbert wrote:
> 
> 
> -----Original Message-----
> From: nisse [mailto:nisse...@home.se] 
> Sent: Wednesday, June 24, 2009 9:21 AM
> To: user@ant.apache.org
> Subject: Using foreach
> 
> /*
> 
> [..]
> 
> 
> This code prints for example "C:/Temp/MyFile.txt"
> But I only want it to print "MyFile.txt", how do I do that in a simple
> way??
> 
> */
> 
> use <basename>, example
> 
> <for param="file">
>  <path>
>   <fileset dir="C:/test" includes="*.txt"/>
>  </path>
> <sequential>
>  <var name="basename" unset="true"/>
>  <basename file="@{file}" property="basename"/>
>  <var name="filenames" value="${filenames},${basename}"/>
> </sequential>
> </for>
> 
> 
> Regards, Gilbert
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-foreach-tp24179911p24180173.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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

Reply via email to