Page 1 of 1

Match Fielname against Binary content - possible?

Posted: Wed Mar 05, 2008 7:16 pm
by welby
Hi, let me say first off I am not a programmer, so please be patient with me.

What I would like to do is look at a directory of files and read the filenames before the extension and check to see if it matches a string of characters in that BINARY file.

For example if we have a file called LOOKHERE.FRT I want to first look at the filename LOOKHERE (disregard the extension) and then look inside the binary file and see if the filename LOOKHERE is present in the binary file.

If it's a match DO NOTHING if it's not either CREATE A LIST or ADD CHANGE THE FILE EXTETENSION to *.BAD.

I am told you can do this in Grep for windows, but I haven't got a clue and thought maybe textpipe could do this with ease, but with the bewildering array of features I must admit it looks so daunting to a novice like my self.

Any help or guidance is most welcome.

Thank you

Posted: Thu Mar 06, 2008 8:09 am
by DataMystic Support
Hi Welby,

What you need to do is write a windows scrpit (in vbscript or jscript) that iterates over the filenames, and calls TextPipe or grep to search the contents. Based on the exit code you can then trigger a rename or do nothing action.

Posted: Thu Mar 06, 2008 11:18 pm
by welby
DataMystic Support wrote:Hi Welby,

What you need to do is write a windows scrpit (in vbscript or jscript) that iterates over the filenames, and calls TextPipe or grep to search the contents. Based on the exit code you can then trigger a rename or do nothing action.
Whoosh.....straight over my head. You might as well be talking in a foreign language.

Thanks anyhow.

Found an simple way to do it using AJCgrep.