java: about counting in txt file
<p>i want to counting some words in txt file<br>
myfile.txt</p>

<pre><code>ABC,xyzwegwegwe
ABC,12312312312
ABC,sdfsdf3sdfs
</code></pre>

<p><br>
how can i count the words"ABC"?<br>
output:<code>"ABC" have: 3</code></p>

<pre><code>while (myfile.hasNextLine()) {
            line = myfile.nextLine();
            lines.add(line);
                    if(xxxxx){ //if have ABC, words++
                        words++; 
                    }
        }
System.out.print("\"ABC\" have: "+words);
</code></pre>
