title: Frequency count of particular field appended to line without deleting duplicates
body: <p>Trying to work out how to get a frequency appended or prepended to each line in a file WITHOUT deleting duplicate occurrences (which uniq can do for me).</p>
  
  <p>So, if input file is:</p>
  
  <pre><code>mango
  mango
  banana
  apple
  watermelon
  banana
  </code></pre>
  
  <p>I need output:</p>
  
  <pre><code>mango 2
  mango 2
  banana 2
  apple 1
  watermelon 1
  banana 2
  </code></pre>
  
  <p>All the solutions I have seen delete the duplicates. In other words, what I DON'T want is:</p>
  
  <pre><code>mango 2
  banana 2
  apple 1
  watermelon 1
  </code></pre>