The term binary file is used to indicate a file that is not a plain text file. If you open a binary file in an application that displays the raw contents of a file, such as a plain text editor, you will see a bunch of weird characters that make no sense. You can only work with such files in a meaningful way using software that can decode the file’s format. Search (and Replace) through Binary Files in Text or Hexadecimal Mode For most people, there is no point in searching through binary files without decoding them. So by default, PowerGREP decodes all the file formats that it understands, and skips all other files that are not plain text files. If you want to include binary files that PowerGREP can’t decode in your search, turn on “search through binary files” on the File Selector panel. If you want to search through the raw contents of files that PowerGREP can decode, set “file formats to convert to plain text” to “(unused)”. If you want to treat plain text files as binary too, set “text encodings to read files with” to “all files as binary”. When you do any or all of this, PowerGREP searches through the raw, non-decoded contents of some or all of your files. Search matches will be listed in the results in both hexadecimal and textual representation. If you double-click on the search match, PowerGREP’s built-in file editor will open the file in hexadecimal mode. The view is very similar to that of a hex editor. To search for a sequence of bytes, rather than a text string, select the “binary data” search type. You can then enter the bytes into the search box as you would enter them into a hex editor. PowerGREP’s regular expression support works equally well with binary files as with text files. You can enter printable ASCII characters as literals in your regular expressions. You can use \x00 through \xFF to match any specific bytes. You can use these in character classes to match sets or ranges of bytes. When PowerGREP treats a file as binary, its regex engine automatically switches to 8-bit mode. | |