How to replace HEX 001A in a file?

Started by mueer01, August 22, 2016, 12:50:57 AM

Previous topic - Next topic

mueer01

Hello,

how can I replace the SUB char 001A in a file, using BinaryReplace? I tried
...
BinaryReplace( binbuf, "\u001a", " ", @TRUE)
and
BinaryReplace( binbuf, "^Z", " ", @TRUE)
...
but it does not replace it.
And using this char directly in the command returns a syntax error.

Regards,
Erhard


td

A Unicode version of BinaryReplace was never implemented for some reason but the alternative is relatively simple:

Code (winbatch) Select
nOffset = BinaryIndexBin(hBin, 0,'00A1',@fwdscan, 1)
BinaryPokeHex(hBin,nOffset, '0020')

; Or this will work instead of BinaryPokeHex.
;BinaryPokeStrW(hBin, nOffset, " ", 1)
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mueer01

YEPP, it works. (But have to use 1A, not A1)
Many thanks

td

Quote from: mueer01 on August 22, 2016, 07:27:36 AM
YEPP, it works. (But have to use 1A, not A1)

Well, at least the idea was communicated despite the  stupid dyslexia...
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade