aspose file tools*
The moose likes Beginning Java and the fly likes help needed with file reading in program. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help needed with file reading in program." Watch "help needed with file reading in program." New topic
Author

help needed with file reading in program.

Derek Grey
Ranch Hand

Joined: Feb 09, 2002
Posts: 204
Hi all,
I am a beginner on posting messages and also on JAVA so please excuse the conventions.
I am having a problem reading a file ....
PROGRAM:
-------

ERROR:
------
mod.java:11: Class TextFileIn not found in type declaration.
TextFileIn f = new TextFileIn("bigfile.txt");
^
mod.java:11: Class TextFileIn not found in type declaration.
TextFileIn f = new TextFileIn("bigfile.txt");
Thanks You'all
[ February 14, 2002: Message edited by: Cindy Glass ]
Les Dsouza
Greenhorn

Joined: Jan 29, 2002
Posts: 27
If TextFileIn is a class defined by you make sure it can be found in one of the folders in your classpath.
Also make sure your classpath includes "." (ie the current folder).
If textFileIn is not in a package, put it in th3e same folder as your main class and then compile.
If TextFileIn is in a package then you need to import it.
You can also check out the following code:
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Cool Looks like you are trying to use the TextFileIn class from the JavaRanch Common
If that is the case, you need to ensure you include common.jar in your classpath and then import com.javaranch.common.TextFileIn; at the top of your class and it should work.
[ February 14, 2002: Message edited by: Carl Trusiak ]

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help needed with file reading in program.
 
Similar Threads
Problem Code
Read and write last lines
Someone up for a challenge?
SortNames FileNotFoundException???
Java APIs for Text file comparison