[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: anyone have software to OCR a PDF?



On Feb 13, 9:54 am, David Wilson <mcs6...@gmail.com> wrote:
> #!/bin/sh
> tr -c '[:alnum:]' '[\n*62]' | sort | uniq -c | sort -n
>
> Hmm - how did those 3 pipes get through the tr?

The reason is that string2 is too short. In the C locale :alnum: is 62
characters but the complement of :alnum: is more like 256-62=194
characters. Replace the 62 with 194 (or even 256) and it works
properly.