I would like to replace a string in a file using a batch file.
The string is:
),(
And I want to replace it by:
),
(
I found several posts, like this one : "how-to-replace-substrings-in-windows-batch-file" but the example uses a dummy string with no special characters.
Thank you !
EDIT
Context: I use mysqldump
to extract a database and I would like every line of the insert command to be on a new line for more visibility.
I don't want to use --extended-insert=false
because it slows down reinsertion of the backup.
EDIT2
Example:
INSERT INTO `dummytable` (`dummycolumn`) VALUES (1),(2),(3);
I want it to be:
INSERT INTO `dummytable` (`dummycolumn`) VALUES (1),
(2),
(3);
Take a look at replacer.bat
Edit without the quotes:
windows style
you can check also FindRepl and JRepl which are more sophisticated tools
This works for me:
In batch if the pattern are always same you could deal with tokens and delims like this:
output:
Edit
I found another way from a npocmaka's post in stackoverflow