view bin/wchar-hist @ 1:95740c6658a3

from Meg
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 10 Jun 2026 13:04:44 +0100
parents 2aa53823fb21
children
line wrap: on
line source

#!/bin/perl
# frequency table of characters
while (<>) {
    grep($cc[$_]++,unpack("C*",$_));
};
for ($i=0;$i<256;$i++) {
    printf("%d %s %d\n",$i,$i>32?sprintf("%c",$i):sprintf("^%c",$i+64),$cc[$i]);
};