Files
hpr_website/www/eps/hpr2610/hpr2610_awk12_ex10.awk

24 lines
327 B
Awk
Executable File

#!/usr/bin/awk -f
#
# Sort the indices as strings in ascending order
#
BEGIN{
PROCINFO["sorted_in"]="@ind_str_asc"
}
#
# Make a frequency table of the first letter of each word
#
{
freq[substr($1,1,1)]++
}
#
# Print the results in the frequency table
#
END{
for (i in freq)
printf "%s: %d\n",i,freq[i]
}