I&#39;m adding some line breaks to make your text a little more readable.<br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 9:55 AM, Susana Iraiis Delgado Rodriguez <span dir="ltr">&lt;<a href="mailto:susana.delgado_s@utzmg.edu.mx">susana.delgado_s@utzmg.edu.mx</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<div>Hello members:</div><div> </div><div>How can I write a statement to execute the following:</div><div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<div>C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr R1G-GEODESIA.shp -where &quot;LAYER = &#39;R1G-GEODESIA&#39;&quot; tapalpa_05_plani_point.dbf</div></blockquote><div> </div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<div>I want my uotput to look like this.</div><div>Instead I&#39;m getting this</div></blockquote><div> </div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<div>C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr T21-PUENTES.shp -where LAYER=+line tapalpa_05_plani_line.shp</div><div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<div>In miy code line is a string given by the user:</div><div> </div><div>for line in open(&quot;unico.txt&quot;, &quot;r&quot;).readlines():</div><div>     p = subprocess.Popen([&#39;C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr&#39;, line+&#39;.shp&#39;, &#39;-where&#39;, &quot;LAYER=&#39;line&#39;&quot;, b+&#39;.shp&#39;])</div>
<div> </div><div>Any suggestions?</div></blockquote><div><br></div><div>Without knowing specifics about what the subprocess.Popen function is expecting as parameters, I can only speculate, but it seems that the following *might* work (for extremely generous values of &quot;*might*&quot;):</div>
<div><br></div><div><div>for line in open(&quot;unico.txt&quot;, &quot;r&quot;).readlines():</div><div>     p = subprocess.Popen([&#39;C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr&#39;, line+&#39;.shp&#39;, &#39;-where&#39;, &quot;\&quot;LAYER=&#39;&quot; + line + &quot;&#39;\&quot;&quot;, b+&#39;.shp&#39;])</div>
</div><div><br></div><div>Details about where the changes are:</div><div>&quot;\&quot;LAYER=&#39;&quot; + line + &quot;&#39;\&quot;&quot;</div><div><br></div><div>Quote to begin the literal: &quot;</div><div>An escaped quote (1) so that there&#39;s a quote inside the literal: \&quot;</div>
<div>Some of the text that&#39;s meant to be unchanging: LAYER=&quot;</div><div>Close Quote: &quot;</div><div>Add the content of the variable &quot;line&quot; from the unico.txt file:  + line +</div><div>Add another literal, composed of just the closing escaped quote to close the quote above (1) : &quot;\&quot;&quot; </div>
<div><br></div><div>See if this works, and let us know how it turns out.</div><div><br></div><div>Antonio Rodriguez</div></div>