renaming output from a xml

Questions and answers on how to get the most out of FFAStrans
Post Reply
rireamar
Posts: 2
Joined: Sat Jan 27, 2018 7:26 am

renaming output from a xml

Post by rireamar »

Congratulation for FFASTrans. I'm using it in a broadcast enviroment and I don't miss other expensive transco software! ;)
My scenario: I want to rename the processed file filenameID to filenameID_Theme. The Theme part comes from a xml filenameID.xml I process
whith xmlscarlet.
My last attemp was
1.use command to execute a .bat passing s_original_name as paremeter: %comspec% /c ""D:\input\xtractTheme.bat" "%s_original_name%""
2. xtractTheme.bat--> xml sel -N x="http://iptc.org/std/nar/2006-10-01/" -T -t -v "//x:slugline" %1.xml >Theme.txt

I'm stucked in this part-->Process exited with error code:3. No Theme.txt was created (the .bat is correct). I think the parameter %s_original_name% doesn't arrive :?:

3. The last part i was thinking to use is use the read() function at Theme.txt

I need a suggestion :idea: to achieve it or use other method
Thank you!
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: renaming output from a xml

Post by admin »

Hi rireamar, thank you for using FFAStrans and welcome to the forum! :-)

Can you please add the following line to a "Command executor"-node for testing purposes?
%comspec% /c "echo %s_original_name%> "%TEMP%\~output.txt""

When completed just open the %TEMP% folder in windows explorer and check if the ~output.txt file contains the desider variable. If it does, then everything is working in FFAStrans.

Just a hint, you should ALWAYS use absolute paths in your commands and scripts. And the reason is this: When FFAStrans executes a command, the default working directory is "%systemroot%\system32" so your command might actually try to put the Theme.txt file in that directory, which FFAStrans proably dont have write access to. So you need to specify exactly WHERE you want your Theme.xml file. Doing that might solve your problem. F.ex:
sel -N x="http://iptc.org/std/nar/2006-10-01/" -T -t -v "//x:slugline" %1.xml > "D:\My\XML\Folder\Theme.txt"

And remember to use "quotes" with file names;-) Hope this helps!

-steinar
rireamar
Posts: 2
Joined: Sat Jan 27, 2018 7:26 am

Re: renaming output from a xml

Post by rireamar »

Thank you for your relpy, Steinar. The forum seemed to be offline and I decided to use a custom Java program to solve the issue. Anyway, thanks again for your excellent software and your attention.
Best regards!
Post Reply