Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. fread() with excel and powerpoint files

fread() with excel and powerpoint files

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 359850
    wrote on last edited by
    #1

    In a non-MFC application I used the fread() function in order to read documents (WORD) EXCEL files and PowerPoint files. The problem is that I get not only the content of those files but also information about the file (like file owner etc.). Is there a way to read only the content of those files?

    V 1 Reply Last reply
    0
    • U User 359850

      In a non-MFC application I used the fread() function in order to read documents (WORD) EXCEL files and PowerPoint files. The problem is that I get not only the content of those files but also information about the file (like file owner etc.). Is there a way to read only the content of those files?

      V Offline
      V Offline
      vmaltsev
      wrote on last edited by
      #2

      I didn't quite understand your question. Could you please rephrase it? Though by look of it you're expecting from fread to understand format of excel and word files. If so, your expectations are wrong. It's low level i/o function and knows nothing about file format, it simply read/write bytes.

      U 1 Reply Last reply
      0
      • V vmaltsev

        I didn't quite understand your question. Could you please rephrase it? Though by look of it you're expecting from fread to understand format of excel and word files. If so, your expectations are wrong. It's low level i/o function and knows nothing about file format, it simply read/write bytes.

        U Offline
        U Offline
        User 359850
        wrote on last edited by
        #3

        didn't expect fread to do nothing but reading :rolleyes: my question is how can i analyze the file format so i can draw from it the content of the file. thanx

        V D 2 Replies Last reply
        0
        • U User 359850

          didn't expect fread to do nothing but reading :rolleyes: my question is how can i analyze the file format so i can draw from it the content of the file. thanx

          V Offline
          V Offline
          vmaltsev
          wrote on last edited by
          #4

          Well, you obviously have to know file format for that. :) I can give you a small hint. Read 2 bytes on offset 0x200. If you have 0x0009, 0x0209, 0x0409, 0x0809 it's Excel file. I don't have much data on PowerPoint format therefore my assumption can be wrong. Nevertheless, if you have 0xA046 there, it's PowerPoint XP(and 2003?). If you have 0xFDFF there, you have to read extra 2 bytes from 0x204 and if you have 0x5eca there, it's PP95 and if the value is 0x5dca, it's PP97(-2002?). Hope it'll help.

          1 Reply Last reply
          0
          • U User 359850

            didn't expect fread to do nothing but reading :rolleyes: my question is how can i analyze the file format so i can draw from it the content of the file. thanx

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Are you against using Excel Automation? Trying to use fread() to weed through a .xls file would be no small undertaking.


            "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups