How do I search/replace hexadecimal values ?

General discussions about Advanced Find and Replace
Post Reply
pstein
Posts: 6
Joined: Thu Nov 02, 2006 5:43 pm

How do I search/replace hexadecimal values ?

Post by pstein »

Is it possible to search and replace hexadecimal values in files ?

I want e.g. to replace the pattern

x'6778AF0A'

by

x'123456AB'

How do I specify the search and replace string in the entry fields ?

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Post by Abacre »

You can use regular expressions for that purpose.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

pstein
Posts: 6
Joined: Thu Nov 02, 2006 5:43 pm

Post by pstein »

How would such an regular expression look like ?

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Post by Abacre »

Read the syntax of regular expressions:
http://www.abacre.com/afr/manual/regexpsyntax.htm

For your example:
Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
\x67\x78\xAF\x0A

Replace with:
\x12\x34\x56\xAB
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

pstein
Posts: 6
Joined: Thu Nov 02, 2006 5:43 pm

Post by pstein »

Can I use regular expressions in "find" and "replace" as well (or only in batch replace)?

I did not see a "regular expression" option on the "find" and the (pure) "replace" tab.

Do I have to select "Native" or "Phrase" instead ?

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Post by Abacre »

In current version the regular expressions are supported on Batch
replace tab. If you want to find with regular expressions: use Batch
replace with Just Find option.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply