Best way to search a text in the file and copy the file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaya3
    New Member
    • Aug 2007
    • 184

    Best way to search a text in the file and copy the file

    Hi All,

    In my java application, i need to search a string (Eg: "Hello") in the list of files in the source directory and i need to copy all the files that matches the search text and copy all those files into another destination directory.

    Problem:

    In my source directory i have lot more number of files , probably 10,000+. I am not sure , whether iterating the files and searching the string using java scanners and copying the file using read() or filechannel() would impact the performance.

    Can anyone share the best way of searching the string in the list of files and copy the files too.


    Thanks in Advance.
Working...