hi all
how i can read from text file please send to me the code

Recommended Answers

All 3 Replies

I see this little class called a "FileReader", it sounds like something you could use.

this little class "FileReader" not found to me although import java.io.* because my tool is NetBeans 5.0 mobility(mobile application)

usama: hi all
how i can read from text file please send to me the code

try {
        BufferedReader in = new BufferedReader(new FileReader([COLOR=#0066ff][I]"inputfilename"[/I][/COLOR]));
        String str;
        while ((str = in.readLine()) != null) {
            [COLOR=#0066ff][I]/*Add your code to process the string*/[/I][/COLOR]
        }
        in.close();
    } catch (IOException e) {
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.