Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sub Folder files copy Problem

 
sasank ch
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • 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.

 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try:

<includesfile name="*.txt"/>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic