i made a batch that can alter the paths in the xml file...so i'll get started incororating it into the main script so you can adjust the path when you build a dump..![Big Grin Big Grin](https://forums.nextpvr.com/images/smilies/biggrin.png)
[paths are hardcoded into the metadata.xml so sometimes need altering]
here's a batch that can adjust the paths afterwards:
run: Alterxml.bat recording-dump.xml
Remember to adjust paths in bold inside first!
adjust the newpath and oldpath at the top and run in same dir as your recording-dump.xml
carefull as the oldpath is case sensitive, but you can run this multiple times on same file to adjust for multiple source dirs..
[or differing case]
EDIT: forgot i could use ^ to escape those problem characters so simplifies things a bit..may rewrite it based on that..lol
![Big Grin Big Grin](https://forums.nextpvr.com/images/smilies/biggrin.png)
[paths are hardcoded into the metadata.xml so sometimes need altering]
here's a batch that can adjust the paths afterwards:
run: Alterxml.bat recording-dump.xml
Remember to adjust paths in bold inside first!
Code:
@echo off
cls
set output=%cd%\out.xml
[b]set oldpath=e:\mpg
set newpath=\\pvr\e\mpg[/b]
setlocal ENABLEDELAYEDEXPANSION
del %output% 2>NUL
for /f "usebackq tokens=1,2,3,4,* delims=<> " %%f in ("recording-dump.xml") do (
set newname=
set tag1=
set tag2=
set tag01=
rem set a var to incoming <tag>data so we can replace filepath. [cannot do with %x vars,only %x%]
set newname=%%h
rem only set if there is a value here. replaces oldpath with newpath.
if not "%%h" == "" set newname=!newname:%oldpath%=%newpath%!
if not "%%g" == "" set tag1=%%g
if not "%%i" == "" set tag2=%%i
rem remove spaces from leading tags.
set tag01=%%f
set tag01=!tag01: =!
rem call export functon to write out data with added "<>". [the tricky part]
call :exportxml "!tag01!" "!tag1!" "!newname!" "!tag2!"
rem pause
)
echo Done!
goto :eof
:exportxml
if not "%~3%~4" == "" echo ^<%~2^>%~3^<%~4^>
if "%~1%~3%~4" == "" echo ^<%~2^>
if "%~2%~3%~4" == "" echo ^<%~1^>
rem check for single tags and output appropriately while adding <>'s.
if not "%~3%~4" == "" echo ^<%~2^>%~3^<%~4^> >> %output%
if "%~1%~3%~4" == "" echo ^<%~2^> >> %output%
if "%~2%~3%~4" == "" echo ^<%~1^> >> %output%
goto :eof
carefull as the oldpath is case sensitive, but you can run this multiple times on same file to adjust for multiple source dirs..
![Smile Smile](https://forums.nextpvr.com/images/smilies/smile.png)
EDIT: forgot i could use ^ to escape those problem characters so simplifies things a bit..may rewrite it based on that..lol
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie