I read this,
Now assume that i want to read a specific Stirng (Like username1 - i mean search a string) from file,
As wanting to see if a certain string value appears in the file rather than identifying the nth value in the file.

It depends quite a bit on unspecified characteristics of the problem. Sorted data could allow a binary search. Fixed length records could make finding value n trivial etc. It could all be moot if "huge data" is only a few megabytes and searches reasonably infrequent: just scanning the file may be a good option.

As usual TMTOWTDI