REPL.BAT simply reads stdin, performs a JScript regex search and replace, and writes the result to stdout. It is also very fast, especially when compared to pure batch solutions. The purely native script does not require installation of any 3rd party executeable, and it works on any modern Windows version from XP onward. I have written a small hybrid JScript/batch utility called REPL.BAT that is very convenient for modifying ASCII (or extended ASCII) files via the command line or a batch file. JREPL.BAT 7.0 and above natively supports unicode (UTF-16LE) via the /UTF option, as well as any other character set, including UTF-8, via ADO!!!! Note - Be sure to see the update at the end of this answer for a link to the superior JREPL.BAT that supersedes REPL.BAT Update Apparently modern windows systems have PowerShell built in allowing you to access this directly using (Get-Content myFile.txt) -replace 'foo', 'bar' | Out-File -encoding ASCII myFile.txt The location of it on my machine is C:\WINDOWS\system32\WindowsPowerShell\v1.0 ![]() Powershell.exe should be part of your PATH statement already, but if not you can add it.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |