FullTextSearch in docx

FullTextSearch in docx

Postby Otto » Sat Dec 19, 2009 7:54 pm

Today I had the necessity to search for a text inside different docx-files in a folder.
As I didn’t found any tool I wrote a small program to convert docx to xml.
Best regards,
Otto



Code: Select all  Expand view


function docx2xml
   local a_dir := directory( "*.docx", "D" )
   local cDirLocal := cFilePath( GetModuleFileName( GetInstance() ) )
   local cFileName := ""
   local I := 0
   local cDst := ""
   local cSrc := ""
   *----------------------------------------------------------

   msginfo("Docx-Dateien in xml umwandeln " + cDirLocal)

   FOR I := 1 to len(a_dir)
      cFileName := left( a_dir[I,F_NAME], (len(a_dir[I,F_NAME]) - 5 ) )
      cDst := ( cDirLocal +  cFileName )

      //temp Verzeichnis anlegen
      lMKDir(cDst)
      cSrc :=  cDirLocal + a_dir[I,F_NAME]      
      filcopyraw( cSrc, cDst + "\temp.zip" )
      DCOM  := '7Z.exe x '  + cDst + "\temp.zip" + " -o" +  cDst  + " *.* -r"

      WAITRUN(DCOM,0)
      SYSREFRESH()

   NEXT  

   msginfo("Ende")

return nil

 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 96 guests