Mercurial > hg > paul
diff bin/char-hist @ 0:2aa53823fb21
new repo
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Sat, 06 Jun 2026 10:19:04 +0100 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/char-hist Sat Jun 06 10:19:04 2026 +0100 @@ -0,0 +1,8 @@ +#!/bin/perl +# frequency table of characters +while (<>) { + grep($cc[$_]++,unpack("C*",$_)); +}; +for ($i=0;$i<128;$i++) { + printf("%d %s %d\n",$i,$i>32?sprintf("%c",$i):sprintf("^%c",$i+64),$cc[$i]); +};
