Sorry to bother everybody, but I'm afraid I'm here again asking for advice. I need to make a program to count how many lines, words and letters are in a text file. I really don't know where to start with this. If somebody could give me a few pointers on how to do it, I would be very grateful.
Start off by reading the file character by character.
If the character is alphanumeric, add one to letters.
If the character is a space, add one to the variable that holds the number of words. ( You can also add some checking to make sure multiple spaces are present and counted as words )
If the character is a newline, add one to the # of lines.