Reading data from Text file  
Author Message
Ryan Dillon





PostPosted: 2005-3-3 11:59:00 Top

java-programmer, Reading data from Text file imran wrote:
> Hello,
>
> I have a problem on reading data from Text file(notepad) and save as
a

It looks like a Properties object is what you need. You could do
something like:

FileInputStream fis = new FileInputStream("injector.txt");
Properties props = new Properties();
props.load(fis);

String classString = props.getProperty("classString");
...


 
Doni Ocena





PostPosted: 2005-3-12 5:04:00 Top

java-programmer >> Reading data from Text file Your problem is that you are only reading one line. You need a loop to
iterate through the rest of the lines.

while ((line = f.readLine()) != null) {
//do your thing here
}