kishor Rangadiya
I have one small doubt , does this code read Microsoft Office suit file format data such as .doc , .docx etc ?
1 Answer(s)      2 years and 6 months ago
Posted in : Java Beginners

import; import; import;

public class ReadFileExample {

public static void main(String[] args) {

    BufferedReader objReader = null;

    try {
        String strCurrentLine;

        objReader = new BufferedReader(new FileReader("D:DukesDiary.txt"));

        while ((strCurrentLine = objReader.readLine()) != null) {


    } catch (IOException e) {


    } finally {

        try {
            if (objReader != null)
        } catch (IOException ex) {


View Answers

May 15, 2013 at 4:16 PM

hi friend,

Yes, your doubt is genuine this code may not read properly the doc or docx etc. (Microsoft Office suit file format) files. If you tried to read these files it would be seem like a corrupted file.

To know how to read doc file in java you can go through the link


Related Tutorials/Questions & Answers: