opening .doc files in unix through C program

This is a discussion on opening .doc files in unix through C program within the Linux Programming forums, part of the Platform Specific Boards category; From the C or C++ program i need to read the contents of the file with extension .doc. It is ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    1

    Angry opening .doc files in unix through C program

    From the C or C++ program i need to read the contents of the file with extension .doc. It is actually the Word document. It contains only the ASCII characters. Is there any way to convert the Word document file with ASCII or junk characters as the normal Word document and read the contents of the file...

    Plz help me in this regard...

  2. #2
    Registered User Engineer's Avatar
    Join Date
    Oct 2001
    Posts
    125
    You can do it if you get source code for Word and Word Reader or something similar. Something like this should be avaliable on the net. Then, after you figure out the exact format Word saves its documents, you will be able to convert them to anything you like.

    Cheers.
    1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    79
    All generalizations are false

  4. #4
    Registered User Engineer's Avatar
    Join Date
    Oct 2001
    Posts
    125
    There is also a program under Unix/Linux that is called word2x or doc2x, that allows you to open .doc files in read-only mode. The source code for it should be available.

    Cheers.
    1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!

  5. #5
    Registered User
    Join Date
    Aug 2001
    Location
    computers/ theatre, travelingstudentL>- Northern California NativeNorthern California3D&Tie-DyeStudent1>. Admirer of C Bangalore Net surfingTeacher >/ >0 nagpurteaching >1  >2
    Posts
    61
    This is what I did about two years ago.

    I wrote a program to open a word document in binary and output the contents in hex with ascii printable characters.

    I then made changes to the document in Word and figured out how it changed to file.

    After about two hours, I was able to edit the document in a C program and view the changes in Word.

    By using the same approach, you should be able to determine where the actual text in a word document is stored in the file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 07-28-2008, 04:10 AM
  2. Replies: 4
    Last Post: 07-24-2008, 10:02 AM
  3. How To Make The Program Installed In Program Files Folder?
    By javacvb in forum Windows Programming
    Replies: 4
    Last Post: 11-05-2003, 05:33 PM
  4. Linking C files (Unix)
    By f97tosc in forum C Programming
    Replies: 3
    Last Post: 03-23-2003, 05:36 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21