aspose file tools*
The moose likes Beginning Java and the fly likes Error reading from input file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error reading from input file?" Watch "Error reading from input file?" New topic
Author

Error reading from input file?

Tom Brodhead
Greenhorn

Joined: Jan 02, 2011
Posts: 25
I'm trying to open a text file for input using the Eclipse IDE and I'm receiving error messages I can't resolve. Here's my code:



Eclipse flags the "String file" line as an error with the following message:


Syntax error on token ";", { expected after this token


It also flags the final } with this message:


Syntax error, insert "}" to complete ClassBody


What am I doing wrong here?

TIA!
~~Tom
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
You cannot just add code to a class. You have to put the code in a method. Also, Stdout is not Java. See below.
Tom Brodhead
Greenhorn

Joined: Jan 02, 2011
Posts: 25
Thanks--this was an embarrassing brain fart--forgot to put it into a method. I'm actually planning on calling the resulting method from a class with a main() method elsewhere; the Stdout routine is part of the larger package this belongs to.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error reading from input file?
 
Similar Threads
Unusual FileNotFoundException error
Flagging duplicate lines when comparing the input from two seperate text files
To find a largest sector in a given input string of 1's and 0's
check values in a csv file in all files in a directory
how to read a file inside a JSP