Can you specify complete phrases, including spaces as a delimiter?
This is what I'm trying to achieve. 2 options. Option 1 works, option 2 doesn't because of the spaces in the delimiter phrase.
Code: Select all
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%x in ('mkvinfo.exe "c:\temp\mkv\folder 5\Jellyfish-3-Mbps - Copy (2).mkv" ^| findstr /i "Title"') do (
set var1=%%x
set var1=!var1:^| + Title: =!
echo !var1!
)
for /f "delims=^| + Title: " %%x in ('mkvinfo.exe "c:\temp\mkv\folder 5\Jellyfish-3-Mbps - Copy (2).mkv" ^| findstr /i "Title"') do (
echo %%x
)
Basically the output from mkvinfo is this:
Code: Select all
| + Title: Jellyfish-3-Mbps: Copy (2)
I need to get the bit after the first colon (so lose '| + Title: '), so in this case Jellyfish-3-Mbps: Copy (2). I can't use colon as a delimiter because it breaks on the colon actually in the file. Plus, some files may contain multiple colons, so I can't use %%x and %%y.
What's the best way?
Thanks!