How to read text files in Java...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to read text files in Java...

  1. #1
    Billy Guest

    How to read text files in Java...


    Hi all,
    i want to write a java program that reads atext file or ms word file
    and generates a summary of that file.

    I mean a kind of abstract of the file.

    What shld i use to achieve this problem?

    please help me out.

    Thanx


  2. #2
    Kyle Gabhart Guest

    Re: How to read text files in Java...


    "Billy" <bsharma@maxindia.com> wrote:
    >
    >Hi all,
    > i want to write a java program that reads atext file or ms word file
    >and generates a summary of that file.
    >
    >I mean a kind of abstract of the file.
    >
    >What shld i use to achieve this problem?
    >
    >please help me out.
    >
    >Thanx
    >


    Billy,

    There is not a way, that I am aware of, to read an MS Word document in Java.
    MS Word is encoded in a proprietary format that Java cannot easily navigate.
    Reading a text file, on the other hand, can be handled in Java. Want you
    want are the classes made available in the java.io package. You will want
    to open a stream to the document, read the contents (or a portion of them)
    into your program, and then perform whatever processing your program requires.
    I have provided three links that I think you will find helpful:

    http://java.sun.com/docs/books/tutor.../io/index.html

    http://www.ifi.unibas.ch/generate.do...urse/chapter11

    http://java.sun.com/j2se/1.3/docs/ap...e-summary.html

    If you have any other questions, feel free to post another question.

    Happy Coding!

    Cordially,

    Kyle Gabhart
    DevX Java Pro



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center