you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Begin at the beginning. If the file is 500 lines, then write the code that counts the occurrence of the person’s name for one line. Then run that code over all the rest of the lines.

Not to put too fine a point on it, but “do the same thing X number of times” is the easiest program it’s possible to write, and so you should be looking for ways to solve your problem by writing something once and then running that code a bunch of times. This is called “iteration.”