generating frequency table from file

Solution 1:

You mean you want a count of how many times an item appears in the input file? First sort it (using -n if the input is always numbers as in your example) then count the unique results.

sort -n input.txt | uniq -c

Solution 2:

Another option:

awk '{n[$1]++} END {for (i in n) print i,n[i]}' input.txt | sort -n > output.txt