thanks Rob. But is there anyway I can read the entire file into the memory and use that??
What should be the approach for reading a large file my file is 100 MB text file
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
The following questions occur:
1. How much of the file do you need in memory at any one time to do whatever it is you are trying to do?
2. Is the file in plain ASCII or what?
3. Why are you closing the reader at all?
Kowshik Nandagudi wrote: . . . But is there anyway I can read the entire file into the memory and use that?? . . .
You can add the file to a List<String>, but careful in case you run out of memory. You can analyse the file and put its contents into a database, and use JDBC calls to retrieve what you need.
There are bound to be lots of other ways to do that.