programming: October 2008 Archives

I've been messing around with OCR for a possible new project. To train Tesseract, I had to decompress and rename a bunch of .tif files. Rather than deal with Photoshop, I decided to hack a little bash script using tiffcp. This also gave me a chance to play with the regex powers of Bash.

#!/bin/bash
for fname in *.g4.tif
do
if [[ $fname =~ (.*)\.g4\.tif ]]
then
tiffcp -c none $fname ${BASH_REMATCH[1]}'.tif'
else
echo "foo"
fi
done

About this Archive

This page is a archive of entries in the programming category from October 2008.

programming: September 2008 is the previous archive.

Find recent content on the main index or look in the archives to find all content.

programming: October 2008: Monthly Archives