1

When I first trained Tesseract the tutorial I used showed a way to run the commands on each relevant file, but I can no longer find that.

How could I run this command for each file:

tesseract [lang].[fontname].exp[num].tif [lang].[fontname].exp[num] batch.nochop makebox
Aurast
  • 87
  • 1
  • 8

1 Answers1

1

For a quick and dirty loop, you can try:

for i in *.tif ; do tesseract $i $i.txt; done;

You can also do it with a find -iname ____ path to select from a subset of files.

If you want to really "parse" filenames, you may want to use a scripting language, or get your bash-foo out.

zeroasterisk
  • 2,199
  • 1
  • 23
  • 28
  • 1
    note that tesseract automatically appends a .txt to the output file name, so having $i.txt would result in a $i.txt.txt output file. – Reuben L. Jul 06 '14 at 04:17