I am at a loss as to why this isn&#39;t working properly:<br><br>#!/usr/bin/python<br><br>import MySQLdb<br>import csv<br>import sys<br><br>try:<br>&nbsp;&nbsp;&nbsp; db = MySQLdb.connect (host = &quot;localhost&quot;,user = &quot;root&quot;,passwd = &quot;########&quot;,db = &quot;stats&quot;)<br>
except MySQLdb.Error, e:<br>&nbsp;&nbsp;&nbsp; print &quot;Error %d: %s&quot; % (e.args[0], e.args[1])<br>&nbsp;&nbsp;&nbsp; sys.exit (1)<br><br>co = db.cursor()<br>csv_data = csv.reader(file(&#39;output.txt&#39;,&#39;r&#39;))<br>headers = csv_data.next()<br>
row = csv_data.next()<br>prefix = row[:17]<br>for i in range(17, len(row),8):<br>&nbsp;&nbsp;&nbsp; next = prefix + row[i:i+8]<br>&nbsp;&nbsp;&nbsp; print next<br>co.execute(&quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp; INSERT INTO stats(Hostname, Time, Arch, PhysicalCPU, Count, Running, Blocked, Paused, Shutdown, Shutoff, Crashed, Active, Inactive, PCPU, TotalMemory, Totalguestmemory, TotalCPUtime, DomainID, Domainname, CPUTime, PGCPU, RDRQ, WRRQ, RXBY, TXBY)<br>
&nbsp;&nbsp;&nbsp; VALUES(&quot;%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s&quot;);<br>&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;, row)<br>co.close()<br>db.commit()<br>db.close()<br><br>It pulls all of the data correctly and it is the correct of items that it is grabbing.&nbsp; I get this traceback:<br>
<br>Traceback (most recent call last):<br>&nbsp; File &quot;./loadcsv.py&quot;, line 21, in ?<br>&nbsp;&nbsp;&nbsp; co.execute(&quot;&quot;&quot;<br>&nbsp; File &quot;/usr/lib64/python2.4/site-packages/MySQLdb/cursors.py&quot;, line 148, in execute<br>
&nbsp;&nbsp;&nbsp; query = query % db.literal(args)<br>TypeError: not all arguments converted during string formatting<br><br>If I have it print out the next variable...the data is correct that it is pulling out...<br><br>[&#39;<a href="http://test.test.net">test.test.net</a>&#39;, &#39;15:33:59&#39;, &#39;x86_64&#39;, &#39;8&#39;, &#39;9&#39;, &#39;1&#39;, &#39;4&#39;, &#39;0&#39;, &#39;0&#39;, &#39;0&#39;, &#39;0&#39;, &#39;5&#39;, &#39;4&#39;, &#39;0.0&#39;, &#39;12495360&#39;, &#39;818688&#39;, &#39;0&#39;, &#39;1&#39;, &#39;beta&#39;, &#39;0.&#39;, &#39;0.&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;]<br>
<br>Maybe fresh eyes could pull out my mistake?<br><br>Thanks again for everything!<br>