How do I modify my syntax to properly read an csv file and write the contents to a shapefile using an update cursor ?
<SPAN class="comment token"># Read csv file & write to shapefile via update cursor</SPAN>
<SPAN class="keyword token">import</SPAN> csv<SPAN class="punctuation token">,</SPAN>os
updateCursor <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>UpdateCursor<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">'sample.shp'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">"Name"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"OrderCount"</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"Time"</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"Miles"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">with</SPAN> open<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">'CsvToShape.csv'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'rb'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> f<SPAN class="punctuation token">:</SPAN>
reader <SPAN class="operator token">=</SPAN> csv<SPAN class="punctuation token">.</SPAN>reader<SPAN class="punctuation token">(</SPAN>f<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> reader<SPAN class="punctuation token">:</SPAN>
route <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
order <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
time <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN>
mile <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> updateCursor<SPAN class="punctuation token">:</SPAN>
row<SPAN class="punctuation token">.</SPAN>setValue<SPAN class="punctuation token">(</SPAN>route <SPAN class="operator token">=</SPAN> Name<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">## row[1]= order</SPAN>
<SPAN class="comment token">## row[2] = time</SPAN>
<SPAN class="comment token">## row[3] = mile</SPAN>
updateCursor<SPAN class="punctuation token">.</SPAN>updateRow<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>