Hey everyone.

I am looking for some advice or better ways of doing the following: I am on CF 5 and 
trying to located 10 words in a word document. In CFMX and Red Sky I can read the M$ 
Word doc with cffile and parse through it no problem... without COM!

In CF5 I can not seem to parse is consistantly (I never get the same results from the 
same document). In addition, since there seems to be some variable size limitations or 
limitations on the amount of data that can be passed to some string functions (CF 5:  
FindNoCase, Find, REFind) I try and loop over the text I read from the cffile in 2500 
character chunks.

The code I am using is below... can anyone see a way to parse a word doc out in CF 5 
resulting in consistant results? If not I can use COM..... although Id rather avoid it.

Code Currently Used:

<cfoutput>

 <cffile action="READ" file="D:\http\medialinq\temptest.doc" variable="docText" />
 
 <cfset textToFind = "automobile" />
    
  <cfloop from="1" to="#Len(docText)#" step="2500" index="currentBlock">
  
   <cfset currentText = Mid(docText,currentblock,2500) />
   
   <cfif FindNoCase(textToFind,currentText) NEQ 0>
   
     <pre>BLOCK [#currentBlock#] - YES</pre><br>  
     #currentText#<br>
     <hr>
     
   <cfelse>
     
     <pre>BLOCK [#currentBlock#] -  NO</pre><br>
     #currentText#<br>
     <hr>
   
   </cfif>
 
 </cfloop>
 
</cfoutput>


Thanks!

Mike


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to