Reading Files using Forte ?
I was writting a little Java program to read a text file.
I created a text file in Forte and wrote some code
to open it and read it and I received a file not found
exception.
Could someone post some sample code to open
and read a file using readline().
Thanks
Tim,
The file is in the same directory as the java code.
I opened a DOS shell and went to that director.
The program ran ok from the DOS shell and displayed
the file I wanted to look at. But I get the exception
from the Forte enviorment.
Any Idea what I am doing wrong ?
Thanks for you help !
Tim,
Forte home directory is C:/forte4j, if the file is not in there and you do not specify the path it won't find it
File f = new File("C:/data/yourFile.txt");
FileReader fr = new FileReader( f );
LineNumberReader lnr = new LineNumberReader( fr );
for( int i = 0; i < graphics.length; i++ )
{
graphics[i] = lnr.readLine();
l = lnr.getLineNumber();
}