The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


pls help regarding text file reading in java.

Posted by Bhargav on December 26, 2001 at 7:02 AM

hello ...i am reading a text file using readLine() but the record which i am reading is very large for the string variable in which i am populating it. and hence at theend itis giving me exception.
my code is like...

File f = new File("Test.txt");
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String rec;

while((rec = br.readLine()) != null)
//some code goes here

itis unable to corporate the whole record in variable "rec"
so what should i do as i have to extract certain data from this record using "substring()" function...
pls help is urgent..
thanking u..


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us