comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:2aa53823fb21
1 #!/bin/perl
2 # frequency table of characters
3 while (<>) {
4 grep($cc[$_]++,unpack("C*",$_));
5 };
6 for ($i=0;$i<128;$i++) {
7 printf("%d %s %d\n",$i,$i>32?sprintf("%c",$i):sprintf("^%c",$i+64),$cc[$i]);
8 };