Finding and combining lines (Strings) together
<p>So I have a String/txt file:
<code>All purchases: blabla : 1 derp : 20 blabla : 1 herp : 30</code> </p>

<p>This is just an example, a real file will be generated based on the users input</p>

<p>So what I need to do is combine the similar strings with similar names (First part) together and make them look like this: <code>(name) : (number) x(amount of same strings)</code></p>

<p>For example lets take the file that we had:
<code>All purchases: blabla : 1 derp : 20 blabla : 1 herp : 30</code></p>

<p>After parsing it must look like: <code>All purchases: blabla : 1 x2 derp : 20 herp : 30</code></p>

<p>I have tried writing down the last value into a variable and checking it with the next value, but what if the values are in a different order? That's where I got stuck.</p>
