• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sub Folder files copy Problem

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have one requirement.Could you please give me any solution.
My folder structures as follows:
Root\
Root\sub1\sample1.txt
Root\sub2\sample2.txt


I need to copy all text files into Target folder.
Please find the my Ant target as follows:
<target name="copyFiles">
<copy todir="C:/Target">
<fileset dir="C:/Root">
<includesfile name="**/*.txt"/>
</fileset>
</copy>
</target>


But it will copies the text files as well as folder sttructue on Target folder.
I am expecting Target folder as follows:
Target\
Sample1.txt
Sample2.txt


Could any body please give me solution for this.

Regards,
Sasank.

 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"sasank ch " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try:

<includesfile name="*.txt"/>
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic