Hi,
can some can through some ideas in searching for a string in a file efficiently .
Thanks,
Printable View
Hi,
can some can through some ideas in searching for a string in a file efficiently .
Thanks,
Have a look at http://www.cs.utexas.edu/users/moore...ing-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.
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