Hi all,
I want to add a check for all video files entering the monitoring folder. I want to exclude files contained in a .txt list from a transcoding workflow.
txt list look like that (each line is video file name):
HPT10104_V2023
HPT10106_v2023
HPT10107B
HPT20105
HPT40102
HPU10106_v2023
HPU20101_B_V2023
HPU20102
HRU80104B_V2023
HRU90101_B_V2023
I've tried it with "populate" & "for each" nodes, but didn't figure it out.
Is it possible to do that? Can someone give an example worflow with it?
Exclude files contained in a .txt list from transcoding
Re: Exclude files contained in a .txt list from transcoding
Hi @DCCentR,
welcome to the Forum and thank you for using FFAStrans!
You could just use the "deny files" input in the monitor processor and insert your list like this:
But that would be no fun at all because too easy, so let me show you how you can potentially deny the files specified in a text file:
The first populate vars processor does all the magic:
The regex part shortly explained:
Assume you have a deny file like
First we transform to a*|b*, then we check if a or b is in the %s_original_filename%. If yes, the $regext function will return either a or b, if no, the regext will return nothing. So if regext returned nothing we can go on, otherwise stop.
I just realize that we can delete the * in the replace part so we end up with a|b instead of a*|b* but i guess it works for you this or that way.
Let me know any questions![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
welcome to the Forum and thank you for using FFAStrans!
You could just use the "deny files" input in the monitor processor and insert your list like this:
Code: Select all
HPT10104_V2023*|HPT10106_v2023*|HPT10107B*|HPT20105*|HPT40102*|HPU10106_v2023*|HPU20101_B_V2023*|HPU20102*|HRU80104B_V2023*|HRU90101_B_V2023
- read text file with list of deny patterns: c:\temp\deny.txt
- replace "newline" character by *| to make it regex compatible (creating the same list i posted above)
- apply the newly constructed regex, if any of the patterns matches, the output of this function will be the matched pattern. if none applies, the output will be empty
- count the characters of the new string after the regex was applied.
The regex part shortly explained:
Assume you have a deny file like
Code: Select all
a
b
I just realize that we can delete the * in the replace part so we end up with a|b instead of a*|b* but i guess it works for you this or that way.
Let me know any questions
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
emcodem, wrapping since 2009 you got the rhyme?
Re: Exclude files contained in a .txt list from transcoding
@emcodem, thank you so much! It's works as it should
I'd like to point out that I had to reverse the order in this expression:
$regext("%s_original_name%, "%s_temp%"") => $regext("%s_temp%", "%s_original_name%")
If this is not done, the result for conditional in both cases will be "true".
Thanks for this wonderful software, guys![Wink ;)](./images/smilies/icon_e_wink.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
I'd like to point out that I had to reverse the order in this expression:
$regext("%s_original_name%, "%s_temp%"") => $regext("%s_temp%", "%s_original_name%")
If this is not done, the result for conditional in both cases will be "true".
Thanks for this wonderful software, guys
![Wink ;)](./images/smilies/icon_e_wink.gif)
Re: Exclude files contained in a .txt list from transcoding
Great, thanks for letting us know.
Well sure it works also the way you did reverse the regex match, it is even easier to understand this way. Well done![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
The limitation is that it does not work with deny patterns anymore but only when the full filename is contained in the deny list.
my version checked if
filename = pattern1|pattern2|pattern3
your version checks the other way around e.g.
pattern1|pattern2|pattern3 = filename
in your version, you actually don't really need to replace the newlines in the deny.txt anymore at all, so in the populate proc this line is not needed:
Well sure it works also the way you did reverse the regex match, it is even easier to understand this way. Well done
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
The limitation is that it does not work with deny patterns anymore but only when the full filename is contained in the deny list.
my version checked if
filename = pattern1|pattern2|pattern3
your version checks the other way around e.g.
pattern1|pattern2|pattern3 = filename
in your version, you actually don't really need to replace the newlines in the deny.txt anymore at all, so in the populate proc this line is not needed:
Code: Select all
%s_temp%= $replace('%s_temp%',@CRLF,"*|")
emcodem, wrapping since 2009 you got the rhyme?