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 » Thu Nov 02, 2006 5:47 pm

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: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Thu Nov 02, 2006 9:05 pm

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 » Fri Nov 03, 2006 9:30 am

How would such an regular expression look like ?

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

Post by Abacre » Fri Nov 03, 2006 2:44 pm

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 » Sat Nov 04, 2006 10:56 am

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: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Sat Nov 04, 2006 11:15 am

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

Who is online

Users browsing this forum: No registered users and 2 guests