How to search for specific record from a file ?
1 posts in topic
Flat View  Flat View

Posted By:   Haider_Mushtaq
Posted On:   Thursday, May 22, 2003 05:44 PM

I want to search a specific record let say all details about employee name "xyz" now how can I retrieve this record using IO from a File not database. This is very important.

Re: How to search for specific record from a file ?

Posted By:   Simon_Ablett  
Posted On:   Friday, May 23, 2003 01:48 AM

It depends. Are the records clearly delimited? Are the rows and columns (!?)ordered in any way? Are they fixed length? Does your file have a readable index? If the answers to the above are no then you will probably need to start at the beginning of the file and perform a linear scan comparing each set of characters with the one you want to find; this could take quite a long time if your file is large. If you have answered yes to any of the above then you have more options. Give me some more detail about your file structure and I will attempt to help you.

About | Sitemap | Contact