Conditionally replace slash with jrepl.bat
Posted: 27 Feb 2022 17:21
With jrepl.bat i am trying to do as follow.
I need to change all slash to backslash in every lines in a .ini text file only when some conditions are met.
example
key0=http://www.websiteinfo.com/somepage/someindex.html
key1=image/a0/a123.wav
key2=images/a0/a1234.wav
key3=./images/a0/a1234.wav
key4=new value 2 / 3.1
key5=new value 2 / 63.3
key6=new value 3 / 3.3 / xxxx
key0,1,2,3 every slash must be replaced with basckslah
key4,5,6 no change must be done
Generally speaking, lines to be changed may end (or start) in some way that i can identify. In the examples above, lines to be changed end with ".wav" but how tell jrepl to replace / with \ ONLY when it finds ".wav" at the end of lines that contain "/" ??
any hint applreciated.
I need to change all slash to backslash in every lines in a .ini text file only when some conditions are met.
example
key0=http://www.websiteinfo.com/somepage/someindex.html
key1=image/a0/a123.wav
key2=images/a0/a1234.wav
key3=./images/a0/a1234.wav
key4=new value 2 / 3.1
key5=new value 2 / 63.3
key6=new value 3 / 3.3 / xxxx
key0,1,2,3 every slash must be replaced with basckslah
key4,5,6 no change must be done
Generally speaking, lines to be changed may end (or start) in some way that i can identify. In the examples above, lines to be changed end with ".wav" but how tell jrepl to replace / with \ ONLY when it finds ".wav" at the end of lines that contain "/" ??
any hint applreciated.