<div><br>Thank you for your help!</div>
<div> </div>
<div>Once I read your comments I tried both corrections in my code, but none of them we&#39;re sucessful. </div>
<div>Tim&#39;s idea kept the quotes at the moment I open the csv in Excel, quotues appeared at the beggining and the end of the row for Excel.</div>
<div>Joel&#39;s idea wrote just tha variable name &#39;filepath&#39; and &#39;&#39;filename&#39;.</div>
<div>The corrections I made were:</div>
<div>import os, csv, time, socket<br>from osgeo import ogr,gdal,osr<br>from dbf import *</div>
<div>gdal.AllRegister()<br><br>file_list = []<br>folders = None<br>for root, folders, files in os.walk( &quot;C:\\&quot; ):<br>     file_list.extend(os.path.join(root,fi) for fi in files if fi.endswith(&quot;.shp&quot;))<br>
 <br>ofile  = open(&#39;csv1.csv&#39;, &quot;wb&quot;)<br>writer = csv.writer(open(&#39;csv2.csv&#39;, &quot;wb&quot;))<br>ruta = &#39;Ruta&#39;<br>archivo = &#39;archivo&#39;</div>
<div>prj = &#39;.prj&#39;</div>
<div>campos = [ruta,archivo,prj]<br>writer.writerow(campos)<br>for row, filepath in enumerate(file_list, start=1): <br>    (ruta, filename) = os.path.split(filepath) </div>
<div>    n = os.path.splitext(filepath)<br>    p = n[0]+&#39;.prj&#39;<br>    filepath = &#39;&#39;+filepath+&#39;&#39;<br>    filename = &#39;&#39;+filename+&#39;&#39;</div>
<div>    if os.path.exists(p):<br>        prj_text = open(p, &#39;r&#39;).read()<br>        prjtext = &#39;&#39;+prj_text+&#39;&#39;<br>        aRow= [ filepath, filename, 1, ]<br>        writer.writerow(aRow)  <br>   else:<br>
        no_prj = &#39;Sin prj, no se puede determinar la proyeccion&#39;<br>        aRow1= [ filepath, filename,0]<br>        writer.writerow(aRow1)</div>
<div>print &quot;El archivo esta listo&quot;</div>
<div> </div>
<div> </div>
<div> </div>
<div class="gmail_quote">2011/3/11 Tim Golden <span dir="ltr">&lt;<a href="mailto:mail@timgolden.me.uk" target="_blank">mail@timgolden.me.uk</a>&gt;</span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>On 11/03/2011 8:59 PM, Susana Iraiis Delgado Rodriguez wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hello list!!<br><br>I&#39;m trying to write a CSV file to work it with Excel. My python script is<br>working, the issue is: when I import the file from excel the data comes with<br>
quotes at the beginnig and ending of the row. I don&#39;t want to have these<br>quotes. What is wrong with my code?<br></blockquote><br></div>Essentially, the work is being done twice.<br>The .writerow method expects a list which it will<br>
convert into a quoted, comma-separated string. You&#39;re<br>giving it a list whose one element is a quoted, comma-separated<br>string.<br><br>Just pass it a list instead:<br><br>writer.writerow ([&#39;Ruta&#39;, &#39;Archivo&#39;, &#39;.prj&#39;])<br>
...<br>writer.writerow ([filepath, filename, 1])<br><br>(BTW, my naive knowledge of Spanish suggests that you&#39;re confusing<br>the two identical-sounding English words: &quot;root&quot; -&gt; &quot;raiz&quot; and<br>&quot;route&quot; -&gt; &quot;ruta&quot;).<br>
<br>TJG<br></blockquote></div><br>