Saving into a temp csv file
<p>I am trying to save into a temp csv file. Although the snippet does not return an error/traceback, it returns an empty temp csv file with the name of the first column from the PermitData csv (even though the next syntax is supposed to skip over that). What is wrong with the snippet? Please provide your meticulous feedback. </p>

<pre><code>import csv

with open('C:\\Users\\Python Files\\output.csv', 'w') as output:
    with open('C:\\Users\\Python Files\\PermitData.csv', 'rb') as f:
        reader = csv.reader(f)
        output.write(next(reader)[0].replace('\t', ' ') + '\n')
        data = list(reader)
        for item in data:
            item = item[0].split(' ')
            if len(item) &gt; 6:
                item[1] = item[1].title()
                output.write(' '.join(item) + '\n')

print 'Output created'
</code></pre>

<p>The row[1] in the PermitData.csv has addresses outlined as:</p>

<pre><code>1234 PRESTON ROAD
4587 RAINING COURT
</code></pre>

<p>I need them like below so I am using the title() to convert the addresses to:</p>

<pre><code>1234 Preston Road
4587 Raining Court
</code></pre>

<p>Since it is inadvisable and not viable to write directly into the PermitData.csv file I am creating a temp file. If there is a way to write directly into the original source, in this case PermitData.csv, please let me know how it is sensibly possible.</p>