Remove double quotes from csv row
<p>I have two files: src.csv and dst.csv. The code below reads the second row from src.csv and appends it to dst.csv. The issue is the output in dst.csv is contained within double quotes (""). </p>

<p>Expected result:</p>

<pre><code>10, 5, 5, 10, 1
</code></pre>

<p>Output:</p>

<pre><code>"10, 5, 5, 10, 1"
</code></pre>

<p>I have tried using <code>quoting=csv.QUOTE_NONE, escapechar=' '</code> in csv.writer and it does remove the quotes though the output now contains a blank space after each csv value.</p>

<p>Here is my code:</p>

<pre><code>import csv

with open('src.csv', 'r') as src, open('dst.csv', 'a', newline='') as dst:
    wr = csv.writer(dst, dialect='excel', delimiter=',', quoting=csv.QUOTE_NONE, escapechar=' ')
    next(src)
    for row in src:
        wr.writerow([row.rstrip('\n')])
</code></pre>

<p>Any suggestions?</p>

<p>I think you have to use <code>csv.reader()</code> to read row as list of number - now you read row as one string and csv.writer has to add <code>""</code> because you have <code>,</code> in this string.</p>

python python-3.x csv