B:BD[
6.119] → [
6.119:278]
B:BD[
3.490] → [
3.490:548]
B:BD[
3.548] → [
6.279:331]
B:BD[
3.598] → [
3.598:636]
B:BD[
3.636] → [
6.332:396]
B:BD[
3.698] → [
3.698:766]
for j in $courrier-*.png
do
l=${j%.png}
tesseract -l fra $j $l
done
cat $courrier-*.txt > $courrier.txt
rm $courrier-*.txt
# Now we remove the header (everyting up to the date)
# sed -i.bak -n '/^Dijon, le/,$p' $courrier.txt
# And everything after the footer
# sed -i.bak '/^BOCAGE SUD.*DIJON CEDEX$/,$d' $courrier.txt
k=$((k+1))
done
rm $dir/courrier*.png
rm $dir/courrier*.txt.bak
for png in p.glob(f"courrier{k}*.png"):
root =png.with_suffix('')
subprocess.run(["tesseract", "-l", "fra", png, root])
txt = p.glob(f"courrier{k}-*.txt")
mergeFiles(txt, p / f"courrier{k}.txt")
# We have to rewrite the glob....
rmFiles(p.glob(f"courrier{k}-*.txt"))
## Now we remove the header (everyting up to the date)
## sed -i.bak -n '/^Dijon, le/,$p' $courrier.txt
## And everything after the footer
## sed -i.bak '/^BOCAGE SUD.*DIJON CEDEX$/,$d' $courrier.txt
#k=$((k+1))
rmFiles(p.glob(f"courrier*.png"))
# rm "$dir"/courrier*.txt.bak