Anonymous user
Letter frequency: Difference between revisions
m
→{{header|REXX}}: made REXX example compliant. -- ~~~~
m (→{{header|REXX}}: made REXX example compliant. -- ~~~~) |
|||
Line 1,136:
=={{header|REXX}}==
<lang rexx>/*REXX program counts the occurances of all characters in a file, */
/* {all Latin alphabet letters are uppercased first}. */
@.=0▼
parse arg fileID .
if fileID=='' then fileID='JUNK.TXT'
▲@.=0
do j=1 while lines(fileID)\==0 /*read file until cows come home.*/
upper
▲ x=c2x(substr(_,k,1)) /*convert the character to hex. */
@.x=@.x+1 /*bump the character's count. */
end /*k*/
end /*j*/
|