How can I grep through djvu files? They are text files with some images in it. Is there some equivalent to pdfgrep tool?
Asked
Active
Viewed 349 times
1 Answers
0
I installed djvutxt and then I use below script to search. I'm sure it can be improved. I tried a lot of find with exec and xarg commands with better or worse results. This seems to be working best for me.
find . -iname "*djvu" | \
while read I; do
echo "$I"
djvutxt "$I" | grep -i $1
done
save as grepdjvu.sh and run as bash grepdjvu.sh text_to_find.
I copied this script from here https://unix.stackexchange.com/a/50319/322998 and modified.
tr53
- 101
djvutxtextracts the text layer (if there is one) and you can pipe that togrep. – njsg Jul 15 '17 at 13:59