Batch File to Replace Text in a Text File

I have a text file "C:TextOutputLJD.txt" where I want to replace "+-" (without the quotes with) "-" (again, without the quotes)

My only option is to do this within a .bat file without installing any 3rd party software.

+-00000000000000 becomes -00000000000000



Is VBscript an option (works out of the box since WinXP)? Also, is replaceing the "+- " to "-" without any conditions (any location, any occurrence? or are there restrictions, like has to be before numbers, always the first position etc)



Is VBscript an option (works out of the box since WinXP)? Also, is replaceing the "+- " to "-" without any conditions (any location, any occurrence? or are there restrictions, like has to be before numbers, always the first position etc)



Anything "out-of-the-box" within Windows is an option. Lots of security lock-downs in the office and there are no conditions. If "+-" exists, replace with "-". Also, I want to save the same file without creating a new one.



Sadly, I can write a VBscript file for this, but it HAS TO BE created as a new file (after that, of course the old file will be deleted and the new file will be renamed to the original). Is that an option?



As long as I finish with the filename the same as when I started, it's all good. There is another script I do not have control of that will look for this file at a specific time and upload it to an FTP site so keeping the same name at the end is critical.



That's a one-liner in Powershell:

Share this

Related Posts

There was an error in this gadget