I have written a batch script to replace a string in text file.
Following is the script.
@echo off &setlocal
set \"search=%1\"
set \"replace=%2\"
How about this, folks?
set search=%1
set replace=%2
set textfile=Input.txt
set line1=with open('%textfile%', 'rw') as f:
set line2=f.write(f.read().replace('%search%', '%replace%'))
python -c "%line1%%line2%"
Muhahaha
Edit:
In a crazy oneliner
python -c "with open('%textfile%', 'rw') as f: f.write(f.read().replace('%search%', '%replace%'))"