Kinook Software Forums

Kinook Software Forums (http://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (http://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Binary file containing string (or regexp) as step condition? (http://www.kinook.com/Forum/showthread.php?t=4920)

Rogier 10-06-2011 10:13 AM

Binary file containing string (or regexp) as step condition?
 
I want to build a step only if a file contains certain data.

For non-binary files, I can use a condition like this:

Quote:

Build only if macro or expression
[vbld_GetFileContents("MyFile.txt")]
Contains
xxx
But this doesn't work for binary files, especially if they contain nul-characters. The expression will only evaluate to the file's contents up to the first \0 byte.

Is there a way to pull this off with binary files?

Bonus question: instead of containing a literal string (like 'xxx' in the above example) is it possible to check for a regular expression match?

kinook 10-06-2011 12:23 PM

You can use the Read File action to look for a regex in a file (and then conditionally build the next step based on the result), but only in text and not binary files. We'll consider supporting binary files in the future, but for now, maybe you could call FIND or FINDSTR?


All times are GMT -5. The time now is 08:30 PM.


Copyright 1999-2019 Kinook Software, Inc.