iterating through folder for files and add up values within the columned file in Python
<p>I have multiple files with data written in two column looks like:</p>

<pre><code>asp 1.88
gln 3.10
arg 0.99
his 1.11
</code></pre>

<p>and</p>

<pre><code>asp 0.99
gln 1.11
arg 0.08
his 0.01
</code></pre>

<p>and so on.  </p>

<p>I wanted to do is add 'em and write to a new file like:</p>

<pre><code>asp 2.87
gln 4.21
arg 1.07
his 1.12
</code></pre>

<p>I was trying with importing <code>Counter</code> but it is not doing well.I tried like this:  </p>

<pre><code>inp = ('c"/users/ansm/desktop/xx.txt','r').read().strip().split('\n')
inp2 = ('c"/users/ansm/desktop/xyz.txt','r').read().strip().split('\n')
c = Counter(inp)
d = Counter(inp2)
print c+d
</code></pre>

<p>but this code is not adding the values for me.
    Is there any other way to do it without using Counter.<br>
I was using <code>glob.iglob</code> to iterate throughout the folder for files with <code>.txt</code> format and then want to process them to get above mentioned result. Will using <code>counter</code> be the most efficient way to do it or some other way will be nice.</p>
