Well, for a start, your code seems to have mismatched curly braces.
You also use the common function name "line" as a variable's name. I'd avoid doing that.
If you are trying to do one loop inside another loop, don't have both of your looping variables named "i".
It's impossible to know how to fix your program/algorithm any more without knowing what the data you're trying to parse looks like.
It might help you to work out how you would do it yourself first, before you try writing the code to do it. What are the steps? Which steps do you do over and over again? Can you draw a flowchart that does it?
Well, you haven't made any progress in making good subject lines, I see. Your other thread https://forum.processing.org/topic/please-i-need-help shows how it is done. Funnily, the sample text you shown explains how you can do word frequency, using a hash table, whose Java implementation is named HashMap. If you search this word from Processing.org (better than from this forum), you might find examples of usage of HashMap for word counting, probably simpler than the example you first found.
Looks like a difficult assignment for somebody of your level. Your teacher said nothing about HashMap?
Leave a comment on PhiLho's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic