这是一个伪代码,可帮助您入门。
open file handle
set counter_line=0
set counter_word=0
set counter_char=0
while iterate file
increment counter_line
split line into array
counter_word += length of split array
counter_char += length of line
end while
close file handle