I want to rename an image with the text in that image. For that I use an OCR and I try to store the name in a variable and use that variable in the mv command but I get mv: target ‘file’ is not a directory. I also want to know how to avoid making the file $item.txt with a pipe.
item=1
convert $item -crop 100%x50% +repage $item
tesseract $item-0 $item
# Delete newlines
tr -d '\n' < $item.txt > name; rm $item.txt
# Delete leading white space
sed -i 's/^ *//' name
name=`cat name`
mv $item $name
Aucun commentaire:
Enregistrer un commentaire