This is the code I think I need help with:
find . -name "*.png" -exec mv "{}" ./"$1"-dir \;
Using pdftohtml in a bash function to get a whole bunch of pdf's (thousands) put into their own folders.
Unfortunately, pdftohtml saves the images in the same folder as the group of pdfs. I'm close now but need help moving all the .pngs into the right folder.
This code for some reason saves all the pdf images in only the last folder created.
#!/bin/bash
function pdf2html {
pdftohtml -c -noframes $1 "$1".html
mkdir $1-dir
find . -name "*.png" -exec mv "{}" ./"$1"-dir \;
mv "$1".html "$1"-dir/"$1".html
}
for f in *.pdf
do
echo $f
pdf2html $f
done
Thanks for your attention!