473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

184 100+
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.
Sep 7 '12 #1
0 1439

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tess | last post by:
Hi, Long time reader, first time poster... Any help is appreciated. I have a few questions regarding Winform controls embedded within an html page. For more info please see the appendix. Now,...
2
by: Paul | last post by:
Dear All, I want to use web form to upload my file and copy the file to another machine. I can upload the file, but when I copy the file(file.CopyTo(".....", true)) to another machine(map...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
2
by: karen.mcdonagh | last post by:
I am trying to copy a file with a css extension using the following code if (!DoesDirectoryExists(sLocation)) { //Create the directory Directory.CreateDirectory(sLocation); } FileInfo test...
1
by: Chris | last post by:
We had an application running on a server that had been working for months with no problem. Last night, without any known change to the server, it started to fail. We tried all kinds of...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
2
by: chennapadmati | last post by:
Hi, I am looking for C function which takes the string and text file and searches for the string and return success or failure. Please send me if any one has the above code Thanks & Rgds...
4
by: taufik | last post by:
hi guys... i new person using vb.net i have some problem in copy a file into specific directory create by user... below is coding that write that may help u all to solve my problem Imports...
1
by: =?Utf-8?B?UmFkZW5rb19aZWM=?= | last post by:
I am using standard File.Copy(source,dest,true) method in C# and I have problem with copying large number of files. Here is my code: foreach (FileInfo file in files) {...
4
by: neoform | last post by:
I was wondering what would be the best search application for indexing/ searching content? Fulltext in MySQL is too slow once you get a db over 1GB. I played around with Zend's version of Lucene,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.