Results 1 to 2 of 2
  1. #1
    siva_vs_siva is offline Member
    Join Date
    Aug 2010
    Posts
    31
    Rep Power
    0

    Default Reading doc file

    i could not read the content of the doc file...
    here is my coding..

    BufferedReader br=new BufferedReader(new FileReader("E:\\ss.doc"));
    String a;
    while((a=br.readLine())!=null)
    {
    System.out.print(a);
    }

    the output is unreadable form.
    is there any mistake in code. or what is procedure do read the doc file

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,338
    Blog Entries
    7
    Rep Power
    20

    Default

    A .doc file isn't an ordinary text file; there is a lot of (complicated) structure in those files. The Apache foundation has an API that enables you to handle those files properly; just BufferedReaders as you were trying to use can't handle those files.

    kind regards,

    Jos

Similar Threads

  1. reading a file and writing to a file....help!!!!
    By java_prgr in forum New To Java
    Replies: 3
    Last Post: 07-26-2010, 06:53 PM
  2. Reading from File
    By eevaa in forum New To Java
    Replies: 4
    Last Post: 05-22-2010, 08:18 AM
  3. Replies: 9
    Last Post: 10-20-2009, 10:52 AM
  4. Replies: 3
    Last Post: 05-09-2009, 11:31 PM
  5. Reading from file
    By kiab3000 in forum New To Java
    Replies: 0
    Last Post: 03-14-2009, 06:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •