Click to See Complete Forum and Search --> : search for a string in a file


arunkumar_gona
September 24th, 2002, 11:48 PM
Hi,

can some can through some ideas in searching for a string in a file efficiently .

Thanks,

cup
September 25th, 2002, 12:06 AM
Have a look at http://www.cs.utexas.edu/users/moore/best-ideas/string-searching/. It is a fairly good starting point. Then look on the net for the two methods mentioned there and the word faster. If there aren't any hits, then possibly no one has formulated a method that is faster than those algorithms.

kuphryn
September 25th, 2002, 04:24 PM
Depending on the type of data file, but there are two primary ways to search a string in a text file. One is via reading one line at a time. A second way is to map the entire file an search the mapped-file.

Kuphryn