I'm trying to use a line of code that will find and replace text with a long string of prefix and suffix code.
Original file:
1. 'text that will go here'
2. 'more text that will be here'
3. 'even more text'
After replace:
youtube-dl -f 'bestvideo[height<=360]+bestaudio/best[height<=360]' --postprocessor-args "-ss 0:0:55 -to 0:1:05" "ytsearch1:text that will go here" -o "text that will go here";
youtube-dl -f 'bestvideo[height<=360]+bestaudio/best[height<=360]' --postprocessor-args "-ss 0:0:55 -to 0:1:05" "ytsearch1:more text that will be here" -o "more text that will be here";
youtube-dl -f 'bestvideo[height<=360]+bestaudio/best[height<=360]' --postprocessor-args "-ss 0:0:55 -to 0:1:05" "ytsearch1:even more text" -o "even more text";
I have the following regex which matches #. ' and replaces it but when I try to replace it with the code, sed won't accept it and shoots out an error. This is what I was trying to use:
sed -e "s/^.*\d. '/youtube-dl -f 'bestvideo[height<=360]+bestaudio/best[height<=360]' --postprocessor-args "-ss 0:0:55 -to 0:1:05" "ytsearch1:/g" original.txt > new.txt
I know why it doesn't work, because the replace with has a bunch of slashes and quotes in it, but I have no idea how to get sed to accept those characters to replace with so it doesn't break the entire command.