I too was concerned with the "distinct integers" requirement. While not as clever as the OCR approach, I appreciate a good one-liner from time to time:
$ echo '2 Here 4 is 4 the week 329.1 test 2 as 1 perl 3 onliner. 1' |\ perl -anE '$s = "@F"; $s =~ tr/[0-9]/ /c; $s =~ s/ +/ /gm; \ @n = do {%h; @h{ split(/ /, $s) } = (); sort {$a <=> $b} keys %h; }; \ say "result: @n"; ' result: 1 2 3 4 329
In reply to Re: OCRing out the Digits
by smile4me
in thread OCRing out the Digits
by adamcrussell
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |