How would I use JREPL.BAT to replace any occurrence of the text "zzz" (without the quotes) in a text file with the UK pound sign? I am using code page 850, Latin-1 (aka ISO-8859-1), for which the UK pound sign has number 163.
I looked for examples, but found nothing that seemed obvious to me.
JREPL.BAT - how to replace with UK pound sign, using code page 850
Moderator: DosItHelp
Re: JREPL.BAT - how to replace with UK pound sign, using code page 850
You don't need a program as complicated as JREPL to perform a replacement as simple as this one. Try this in a Batch .bat file:
If the output file have not the right UK pound sign, try to hard-write it between quotes in place of String.fromCharCode(163).
For a further description on the replace method, see this page.
Antonio
Code: Select all
@set @a=0 /*
@cscript //nologo //E:JScript "%~F0" < input.txt > output.txt
@goto :EOF */
WScript.Stdout.Write(WScript.Stdin.ReadAll().replace(/zzz/g,String.fromCharCode(163)));
For a further description on the replace method, see this page.
Antonio
Re: JREPL.BAT - how to replace with UK pound sign, using code page 850
Code: Select all
cmd /c ""JREPL.BAT" "zzz" "\xA3" /XSEQ /F "test.txt" /O -"