3

How can I grep through djvu files? They are text files with some images in it. Is there some equivalent to pdfgrep tool?

Pierre B
  • 2,213

1 Answers1

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