Search through Binary Files to Find (and Replace) Text or Byte Sequences in Hexadecimal Mode
Which Files Are Binary Files
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. Picture files such as BMP or JPG files are binary files. You need a paint or graphics program to edit them.
Many applications store their data in binary files. These files often use file formats that are proprietary to the developer of the application. Such files generally cannot be processed by software other than the software that created them.
Microsoft Word documents, Excel spreadsheets, PowerPoint presentations, Outlook mailboxes, PDF files, database files (except SQL queries), executable files and libraries, WinHelp and CHM files, GIF, PNG and JPEG image files, MP3 and WMA songs, and AVI and MPEG movies are all examples of binary files.
Search (and Replace) through Binary Files in Text or Hexadecimal Mode
PowerGREP is primarily designed to search through plain text files. The option "search binary files" is off by default, meaning that binary files will not be searched through at all.
If you turn this option on, PowerGREP will search through the raw, non-decoded contents of the file. The search match will be listed in the results in both textual and hexadecimal 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.
When making replacements, you do have to be careful with what you are doing. It is easy to mess up the structure of a binary file, making it unreadable. While you can easily search through an Excel file, for example, making a replacement in an Excel file will often corrupt the file, and Excel will not be able to open it. If you understand the file format that you are working with, PowerGREP can definitely automate many file maintenance tasks. PowerGREP's regular expression support works equally well with binary files as with text files, and you can write the regular expression in hexadecimal mode or in text mode.
|Searching through binary files with PowerGREP in hexadecimal mode|
File Formats That PowerGREP Can Decode
Get Your Own Copy of PowerGREP Now
There are two ways in which you can get your own copy of PowerGREP and evaluate the software risk-free.
The best option is to buy your own copy of PowerGREP for US$ 159. Your purchase is covered by Jan Goyvaerts's personal three month risk-free unconditional money-back guarantee. This allows you to try the software without any limitations and without any risk for three months.
Alternatively, you can download the free evaluation version of PowerGREP. The free evaluation version can be downloaded anonymously. It allows you to explore PowerGREP for 15 days of actual use. Full documentation is included. The documentation extensively covers both PowerGREP itself, and the regular expression syntax.