pdfgrep - Execute command result as Private data

Post Reply
User avatar
PrepressNinja
Newbie
Posts: 7
Joined: Fri Feb 16, 2018 5:46 pm

pdfgrep - Execute command result as Private data

Post by PrepressNinja »

Howdy, I've had no luck after ~6 hours of playing with this and would greatly appreciate guidance.
How can I capture the text result of grep into Private data?

Working terminal code which gives a text file with the grep match:

Code: Select all

pdfgrep  -P 'T\d+' TEST.pdf | tee output.txt
I need to assign the stdout to private data, although I couldn't even get a "sidecar" asset to generate with this:

Code: Select all

pdfgrep  -P 'T\d+' '%1' > '%2\[Job.NameProper].txt'
I have 'Command or path' set to /opt/homebrew/bin/pdfgrep
'Output' Updated input job (also tried to see a text file alongside with 'result next to input')
'Exit code' Discard
'Stdout' Attach as dataset
'Stderr' Discard
Disregard exit codes

My bash knowledge is poor and the syntax required for 'Execute command' is occult to me as well! Thanks so much for reading.
▬▬ι═══════ﺤ
Padawan
Advanced member
Posts: 362
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: pdfgrep - Execute command result as Private data

Post by Padawan »

Execute command can save the stdout to a dataset, but not to private data. It also does not use a shell, so piping and redirecting doesn't work without an intermediate shell file.

If you use the free app Run command, then you can save to private data and you can use redirecting and piping. That will most likely be the easiest solution to your problem.
https://www.enfocus.com/en/appstore/product/run-command

The command syntax is slightly different, you will have to check the documentation to set it up. However should not take 6 hours at all.
User avatar
PrepressNinja
Newbie
Posts: 7
Joined: Fri Feb 16, 2018 5:46 pm

Re: pdfgrep - Execute command result as Private data

Post by PrepressNinja »

Hey Padawan. Thank you so much for this suggestion, it works perfectly for this project!

To pay it forward, here is the working setup (note I needed to use the full path to pdfgrep due to 'zsh command not found' errors):

Code: Select all

Shell: Zsh
Command: /opt/homebrew/bin/pdfgrep -P 'T\d+' '%%InputFilePath%%'
Std Out Private Data: StandardOutput
Returns the grep match as private data!
▬▬ι═══════ﺤ
Post Reply