Replace one word with multiple words w/ BatchSubstitute.bat?
Posted: 14 Jan 2010 20:38
I am trying to replace a single word in a file with multiple words (a multi-word string of text). I imagine it's easy but have not yet cracked it.
For example, replace the string "Yellow Submarine" with "Blue Submarine" in color.txt and pipe it into a new file called newfile.txt.
Below are my two attempts, and the error messages returned in each case.
(1.) I tried:
BatchSubstitute.bat "Yellow Submarine" "Blue Submarine" color.txt>newfile.txt
This was returned:
Submarine" "Blue was unexpected at this time.
(2.) I tried:
BatchSubstitute.bat "Yellow Submarine" Blue Submarine color.txt>newfile.txt
This was returned:
Submarine" Blue Submarine color.txt"=="" was unexpected at this time.
I'm not a programmer (former web developer/HTML coder actually) and I don't know VB. I would like to do this with BatchSubstitute.bat if possible.
Any help appreciated!
Steve
For example, replace the string "Yellow Submarine" with "Blue Submarine" in color.txt and pipe it into a new file called newfile.txt.
Below are my two attempts, and the error messages returned in each case.
(1.) I tried:
BatchSubstitute.bat "Yellow Submarine" "Blue Submarine" color.txt>newfile.txt
This was returned:
Submarine" "Blue was unexpected at this time.
(2.) I tried:
BatchSubstitute.bat "Yellow Submarine" Blue Submarine color.txt>newfile.txt
This was returned:
Submarine" Blue Submarine color.txt"=="" was unexpected at this time.
I'm not a programmer (former web developer/HTML coder actually) and I don't know VB. I would like to do this with BatchSubstitute.bat if possible.
Any help appreciated!
Steve