great! with your feedback got the first grep working!,
Now trying to get the second part to work.
(tested the Execute shell command, but the script didn't seem to work. Plus, I'm not well versed in grep/awk, so tried to look for alternate method).
Found this thread and the counter is working!, opened a file and pasted its content inside, and displays the number of occurrences of the word </Preset>
:
Summary
I also found a thread about splitting path and filename... which I seem to have lost.
EDIT2: Nevermind, found a thread about Get File Attribute
EDIT: Almost there, needed to change block to this: