Find and replace hex code

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
atglma
Posts: 2
Joined: Tue May 20, 2003 11:16 am

Find and replace hex code

Post by atglma »

I am having difficulty with the find & replace function.
I want to replace hex 0C with hex 20 (SI with space) and although I can use the find function to find 0C (with the hex radio set) this does not work in the find and replace function. It just has no visible effect. I've also tried setting the text radio button and using \x0C but has the same result (or lack thereof).

Any suggestions gratefully recieved
User avatar
helios
Posts: 711
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

Please see the example below, and check the conditions for "Text" and "Regular Expression", in the Replace dialog box.

\xdd --- Substitute the character with hex code dd (must be 2 hex digits, excluding 00).

Stephen MacDonald
Helios Software Solutions
http://www.textpad.com
Helios Software Solutions
atglma
Posts: 2
Joined: Tue May 20, 2003 11:16 am

Post by atglma »

I'm trying -

Find what: \x0C
replace with: \x20
Text: set
Hex: unset
Match case: unset
regular expression: set

and ...
Find what: \x0C
replace with: \x20
Text: set
Hex: unset
Match case: set
regular expression: set

and ...
Find what: 0C
replace with: \x20
Text: unset
Hex: set

and ...
Find what: 0C
replace with: 20
Text: unset
Hex: set

All of the above with active document selected and single file opened in binary.

Cheers
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

All of the above with active document selected and single file opened in binary.
Binary? The Hex View?

In Textpad, Hex View is just a view but not a Hex edit....
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

helios wrote:\xdd --- Substitute the character with hex code dd (must be 2 hex digits, excluding 00).
Sorry to lazarus this thread but is there any reason for this restriction? I received an aweful file from a legacy system today that I wanted to strip the non-printing characters from. I fired up my trusty Textpad (4.7.0) and I was able to strip out the \f no problem but when I went to yank out the NULLs I thought I was going insane. I could highlight the 00 and hit F5 but it'd never find anything, even the instance it was sitting on. Manually typing the 00 as Hex wasn't working. At least now I know I'm not going insane because Find can't locate \x00 but is there any reason for this limitation?
I choose to fight with a sack of angry cats.
Post Reply