-3

suppose there is a folder 'Videos' with file names 1.avi ,2.avi ,3.avi ,4.avi .. till 100.avi . i have created a program that outputs some numbers (let's say 92 , 31 , 92 ,85, 45 ) . now i want all the files named 92.avi , 31.avi , 92.avi ,85.avi , 45.avi to be copied to another folder named 'Chosen Videos' note that 92 occurs two times so i want it to be copied 2 times.first one as 92.avi and the second one 92(1).avi

how to do this in java or php

user725821
  • 15
  • 1
  • See [this SO post](http://stackoverflow.com/questions/300559/move-copy-file-operations-in-java) which talks about Copy/Move in Java (there is no *standard* support in JDK6) and see [File.list](http://download.oracle.com/javase/6/docs/api/java/io/File.html#list%28%29) to get a directory file listing. –  Jun 17 '11 at 18:13
  • (It is also generally poor SO practice to ask a "how to" question over multiple *very distinct* languages.) –  Jun 17 '11 at 18:16
  • (If you're going to down-vote, please also vote to close...) –  Jun 17 '11 at 18:18

1 Answers1

0

For java, take a look at the FileUtils class here.

talnicolas
  • 13,885
  • 7
  • 36
  • 56