The script I posted above works fine except when you have a '&' in your filename.
I have a solution for this buts its rather clumsy
I first save the filenames in the .wme file including the quotes around the filenames and then use sed (search with google for "sed windows" and you can find a precompiled version for DOS, must be a command line version, put in the same dir as the postprocessing.bat)
below you can find my latest postprocessing.bat, it works for me
if you want to update all your .wme files run this command in a .bat file in the same directory as where postprocessing.bat can be found
for %%f in (*.txt) do postprocessing.bat "%%f"
where you modify *.txt to refer to the directory where the .txt files are located. You can run the command as often as you want, it simply will recreate the .wme files. If the .txt files already exist you better put a rem before comskip to speed things up
Please remember to install the sed.exe. A good sed.exe can be found here
http://unxutils.sourceforge.net/
--------------------------------------------------------------------
@echo off
Rem PostProcessing.bat
rem Initialize the variables
set count=1
set start=0
rem Identify the commercials
comskip %1
rem Create the cliplist
echo # >x.tmp
rem Process all the lines from the Comskip output file
for /F "usebackq tokens=1,2,3*" %%i in ("%~dpn1.txt") do call :work %%i %%j "%%~dpn1" >>x.tmp
rem Output last clip
echo CLIPLIST: #%count% show >>x.tmp
echo CLIP: "%~dpn1.mpg" >>x.tmp
echo 6 %start% 1000000 1 192 0 1 224 0 0 0 0 0 0 >>x.tmp
rem Run sed to remove the quotes around the file names in the .wme file
sed >"%~dpn1.wme" s/\"//g x.tmp
rem Should delete the x.tmp file, but I am too lazy.....
rem Done.
goto :eof
:work
rem Skip useless lines
if "%1"=="FILE" goto :eof
if "%1"=="-------------------" goto :eof
rem Output the clip information for the show part
set /A length=%1-%start%
echo CLIPLIST: #%count% show
echo CLIP: "%~dpn3.mpg"
echo 6 %start% %length% 1 192 0 1 224 0 0 0 0 0 0
set/A count=%count%+1
rem Output the clip information for the commercial part
set /A length=%2-%1
echo CLIPLIST: #%count% commercial
echo CLIP: "%~dpn3.mpg"
echo 6 %1 %length% 1 192 0 1 224 0 0 0 0 0 0
set/A count=%count%+1
rem Remember start of next clip
set start=%2
goto :eof
:eof
I have a solution for this buts its rather clumsy
I first save the filenames in the .wme file including the quotes around the filenames and then use sed (search with google for "sed windows" and you can find a precompiled version for DOS, must be a command line version, put in the same dir as the postprocessing.bat)
below you can find my latest postprocessing.bat, it works for me
if you want to update all your .wme files run this command in a .bat file in the same directory as where postprocessing.bat can be found
for %%f in (*.txt) do postprocessing.bat "%%f"
where you modify *.txt to refer to the directory where the .txt files are located. You can run the command as often as you want, it simply will recreate the .wme files. If the .txt files already exist you better put a rem before comskip to speed things up
Please remember to install the sed.exe. A good sed.exe can be found here
http://unxutils.sourceforge.net/
--------------------------------------------------------------------
@echo off
Rem PostProcessing.bat
rem Initialize the variables
set count=1
set start=0
rem Identify the commercials
comskip %1
rem Create the cliplist
echo # >x.tmp
rem Process all the lines from the Comskip output file
for /F "usebackq tokens=1,2,3*" %%i in ("%~dpn1.txt") do call :work %%i %%j "%%~dpn1" >>x.tmp
rem Output last clip
echo CLIPLIST: #%count% show >>x.tmp
echo CLIP: "%~dpn1.mpg" >>x.tmp
echo 6 %start% 1000000 1 192 0 1 224 0 0 0 0 0 0 >>x.tmp
rem Run sed to remove the quotes around the file names in the .wme file
sed >"%~dpn1.wme" s/\"//g x.tmp
rem Should delete the x.tmp file, but I am too lazy.....
rem Done.
goto :eof
:work
rem Skip useless lines
if "%1"=="FILE" goto :eof
if "%1"=="-------------------" goto :eof
rem Output the clip information for the show part
set /A length=%1-%start%
echo CLIPLIST: #%count% show
echo CLIP: "%~dpn3.mpg"
echo 6 %start% %length% 1 192 0 1 224 0 0 0 0 0 0
set/A count=%count%+1
rem Output the clip information for the commercial part
set /A length=%2-%1
echo CLIPLIST: #%count% commercial
echo CLIP: "%~dpn3.mpg"
echo 6 %1 %length% 1 192 0 1 224 0 0 0 0 0 0
set/A count=%count%+1
rem Remember start of next clip
set start=%2
goto :eof
:eof
P4 3GHz 1GB, 250GB, nVidia dualTV, GBPVR 1.3.11, XP
Support Comskip, visit the forum and donate at http://www.comskip.org/
Support Comskip, visit the forum and donate at http://www.comskip.org/