title: How do I implement a function to count how many songs an artist has in Java
body: <p>What I want to do is count how many songs an artist has within a text file of over 100,000 lines of different songs and different artists.
  For example: If I have 3 lines in the text file and all of them are by Elvis Presley it should have an output similar to this.</p>
  <pre><code>Who let the dogs out | Elvis Presley | (1) 
  Can't help falling in love | Elvis Presley | (2)
  Hound Dog | Elvis Presley | (3)
  </code></pre>
  <p>I've got it to do what I want up until that number part where it counts how many songs it's put out. If anyone could help me understand how I could implement this I'd be really appreciative.</p>