File Search and Unicode Files

Started by BradG, August 08, 2014, 11:07:13 AM

Previous topic - Next topic

BradG

Hi,

I have a need to search a large directory for files containing a list of keywords.   I'm using the srchInit family of functions in wsrch34i.dll.  This works great, except when it encounters unicode files.

I'm using 32bit Winbatch version 2014A. 

Is there any method to find keywords in unicode files?

Would using the x64 bit version help?

Also, related to the x64 bit version of the product, I get the following error message when I try to install some extenders:

"This setup program has detected and expired WinBatch+Compiler maintenance plan which does not cover the version of this extender that you are installing.  Installation skipped...."

As far as I can tell, I have entered all of the appropriate registration numbers to activate the product.

Thanks,


Also - I just noticed in the documentation:  "This function does not support unicode files."  Other suggestions?


Deana

Unfortunately the File Search Extender doesn't currently support Unicode, but the File and Folder Finder Extender does. However the File and Folder Finder Extender doesn't explicitly search the contents of the file. So, I recommend using the File and Folder Finder Extender to quickly locate the files of choice then use the Binary functions to quickly search each file for the keywords.

No need to use 64-bit Extender, as that does not relate to Unicode support.

In order to install any of the latest extender you must have a current maintenance plan. To confirm your maintenance, Launch: Start Menu | WinBatch | Winbatch.exe. Select 'License Info' button in the lower left hand corner. Confirm the maintenance expiration data has not passed. If it is expired, you can obtain archived copies of the Extenders here: http://www.winbatch.com/download.html#dlprevious
Deana F.
Technical Support
Wilson WindowWare Inc.

BradG

Thanks,

Would BinaryIndexBin be the best approach?  Convert the search string to Unicode and pass this as "item"?

My maintenance is good through 3/2015.

BradG

I believe I have the extender update issue resolved, except for installing the update for [img][img]  (search extender)

Deana

Quote from: BradG on August 08, 2014, 12:11:15 PM
I believe I have the extender update issue resolved, except for installing the update for [img][img]  (search extender)

Make sure you are not running any scripts using that extender while running the Extender install. To be safe close any running WinBatch tools and processes, before attempting to install any extenders.
Deana F.
Technical Support
Wilson WindowWare Inc.

Deana

Quote from: BradG on August 08, 2014, 11:58:53 AM
Thanks,

Would BinaryIndexBin be the best approach?  Convert the search string to Unicode and pass this as "item"?

My maintenance is good through 3/2015.

If your file is Unicode, then I would suggest using BinaryIndexBin, because it can search for strings containing NULL bytes.

For Example:

Code (winbatch) Select

file = 'C:\temp\unicode.txt' ; Unicode file containing: The quick brown fox jumps over the lazy dog

;Convert Keyword to Unicode then Hex
keyword = 'fox'
keyword = ChrUnicodeToHex( ChrStringToUnicode( keyword ) )

binbuf = BinaryAlloc( FileSize(file) )
If binbuf == 0
   Message("Error", "BinaryAlloc Failed")
Else
   BinaryRead( binbuf, file)
   ptr = BinaryIndexBin( binbuf, 0, keyword, @Fwdscan,@FALSE )
   binbuf = BinaryFree( binbuf )
EndIf
Message("Binary Pointer", ptr)


Deana F.
Technical Support
Wilson WindowWare Inc.