1.

Solve : Parsing through a .doc file?

Answer»

I was wondering if there is a way to parse a .doc file and capture certain key elements and output them to a file? This is what I ATTEMPTED:

Code: [Select]::Creates the directory !Grants if it does not exist
if not exist !Read MKDIR !Read
pause

for %%I in (*Deployment*.doc) do (
find "OMG" %%I >> !Read/Reader.txt
pause
)
The .doc file, DeploymentPlan.doc, is as follows:

OMG WORKED
1
!! !
LOLOMG
OMGWTF

and the output is ATTACHED, when I copied it into this window it formats it differently to match what the .doc originally has, however when in the .txt it uses characters to represent what I now realizes are line breaks.

Thanks in advance.


[Saving space, attachment deleted by admin]you don't really read doc FILES like that. Use COM and vbscript. See here and here for 2 examples.Well can you execute a find on a word doc and have it produce expected results, not just all information within the doc?a word DOCUMENT is written in a binary format.

best way to do something like this is to use Word through OLE Automation.



Discussion

No Comment Found