Hi, how can i make my search fast using file connection

Hello friends,

i m using nokia 6681 model and i m trying to read text file using jsr 75. wen i try to search 100th record file pointer traverses all the 99 records and then it finds the targe.......

Actually a want to make my search fast..........

Is there any idea ......

Plz help me out.....

Thanks & Regards

Parag

[363 byte] By [ParagPatila] at [2007-11-27 7:58:06]
# 1
is your file sorted?the problem is that you must know the lines number before sorting it..and can you show us your search algorithm?
suparenoa at 2007-7-12 19:39:59 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

I had a search feature where I had to go through about 300 lines of a text file to find a building name.

I found that by splitting up the list into three 100 line files and loaded the file based on the users search I could dramatically reduce the seek time.

Ie. The user searches for building 'Bellfield Hall'

I look at the first letter (B) and then know to open

a-k.cfg

and ignore

l-s.cfg, t-z.cfg

If that is not possible you can try sorting your file by relevance. So if there is a term which your users are very likely to search for you should thik about having it nearer the start of the file.

Message was edited by:

aClelland

aClellanda at 2007-7-12 19:39:59 > top of Java-index,Java Mobility Forums,Java ME Technologies...