You are not logged in.
Pages: 1
Hi everybody,
I can't fond a solution to my issue. Hopefully you could help me.
I have a few thousands of pdf files that I need to sort and move to different directoried based on the keyword in the content.
I use pdfgrep to list the files and trying to use xargs to move them.
Example:
pdfgrep -Hir 'text' | xargs -I'{}' mv '{}' 'Destination Directory'It looks like xargs is trying to move the file based on the keyword (and obviously can't find the file).
How do I tell xargs to use the filename from the pdfgrep output?
Last edited by Sergeif (2023-03-30 16:18:41)
Offline
Look at the output of that pdfgrep command (before piping it) and it should be obvious.
Then read the pdfgrep man page for the -l flag.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
https://man.archlinux.org/man/community … fgrep.1.en
There's an option that does exactly what you want and it's not "-H"
Offline
Look at the output of that pdfgrep command (before piping it) and it should be obvious.
Then read the pdfgrep man page for the -l flag.
https://man.archlinux.org/man/community … fgrep.1.en
There's an option that does exactly what you want and it's not "-H"
Thanks a lot. It's working.
Offline
Pages: 1