I would like to replace the following String in a file:
android:versionName=\"anyStringHere\" >
*anyStringHere represents any possible s
This is a robust solution that retains all formatting. It uses a helper batch file called repl.bat
- download from: https://www.dropbox.com/s/qidqwztmetbvklt/repl.bat
Place repl.bat
in the same folder as the batch file or in a folder that is on the path.
type "file.txt" | repl "(public static String CONST = \q).*(\q.*)" "$1def$2" x >"newfile.txt"