Skip to content

Instantly share code, notes, and snippets.

@cneud
Created February 25, 2021 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cneud/9a05430ec9569f079acb64f62efb80ee to your computer and use it in GitHub Desktop.
Save cneud/9a05430ec9569f079acb64f62efb80ee to your computer and use it in GitHub Desktop.
Windows batch processing with Tesseract (because I always forget)
:Start
@Echo off
Set _SourcePath=C:\path\to\images\*.tif
Set _OutputPath=C:\path\to\output\
Set _Tesseract=C:\path\to\tesseract\tesseract.exe
Set _TesseractLang=lang
Set _TesseractOutputFormat=alto
:Convert
For &&A in (%_SourcePath%) Do Echo Processing %%A...&%_Tesseract% -l %_TesseractLang% %%A %_OutputPath%\%%~nA %_TesseractOutputFormat%
:End
Set "_SourcePath"
Set "_OutputPath"
Set "_Tesseract"
Set "_TesseractLang"
Set "_TesseractOutputFormat"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment