fread() with excel and powerpoint files
-
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?
-
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?
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.
-
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.
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
-
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
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.
-
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
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