<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: replace data sources script not returning to for loop in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645100#M2124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're still interested, I took this a little farther, maybe overkill but...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It will use a text file for input or from command line. It will also walk a directory structure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --help to see the options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Text file looks like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# Layername or Source, Layername or SourcePath, Connect To, Featureclass
Layername,Artwork,Database Connections\PublicUser.sde,SDE.Artwork
Source,C:\Documents and Settings\user\Application Data\ESRI\ArcCatalog\publicuser.sde\SDE.BaseMap\SDE.Call_Box,Database Connections\user.sde,SDE.Call_Box
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Syntax for file input would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --dirpath c:\temp --norecurse --infile c:\temp\replace.txt --filelist c:\temp\test.mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Syntax for command line would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --dirpath c:\temp --norecurse --filelist c:\temp\test.mxd --dest "Layername,Artwork,Database Connections\PublicUser.sd
e,SDE.Artwork" --force
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A note about the sample syntax. If --filelist is specified, --dirpath and --norecurse are ignored.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 03:23:38 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T03:23:38Z</dc:date>
    <item>
      <title>replace data sources script not returning to for loop</title>
      <link>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645097#M2121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jgustine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having a problem with the attached script and was hoping someone sees something I don't. We did a large data migration from shapefiles in a fileshare to a single SDE database for one of our customers. My goal is to automate the repathing process with script that loops thru the MXD directories and uses the replaceDataSource method to insert the new data sources. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The attached script reads from a text file (also attached) to check for and change data source info. It sucessfully runs thru and replaces the 1st layer in each map document, but will not continue to the next? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone see any syntax/indentation problems. Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 18:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645097#M2121</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-01-18T18:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: replace data sources script not returning to for loop</title>
      <link>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645098#M2122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not so hot with Python but do you need to reset your position in your text file, some sort of reset pointer to beginning of text file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jan 2011 13:43:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645098#M2122</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2011-01-19T13:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: replace data sources script not returning to for loop</title>
      <link>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645099#M2123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jgustine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, that actually helped alot. Instead&amp;nbsp; of opening the text file at the begining of the script it needed to be opened within the "for lyr in lyrList" loop. Here's the working script if anyone's interested. Just need to add in some error logging. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jan 2011 20:12:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645099#M2123</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-01-19T20:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: replace data sources script not returning to for loop</title>
      <link>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645100#M2124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're still interested, I took this a little farther, maybe overkill but...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It will use a text file for input or from command line. It will also walk a directory structure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --help to see the options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Text file looks like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# Layername or Source, Layername or SourcePath, Connect To, Featureclass
Layername,Artwork,Database Connections\PublicUser.sde,SDE.Artwork
Source,C:\Documents and Settings\user\Application Data\ESRI\ArcCatalog\publicuser.sde\SDE.BaseMap\SDE.Call_Box,Database Connections\user.sde,SDE.Call_Box
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Syntax for file input would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --dirpath c:\temp --norecurse --infile c:\temp\replace.txt --filelist c:\temp\test.mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Syntax for command line would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --dirpath c:\temp --norecurse --filelist c:\temp\test.mxd --dest "Layername,Artwork,Database Connections\PublicUser.sd
e,SDE.Artwork" --force
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A note about the sample syntax. If --filelist is specified, --dirpath and --norecurse are ignored.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:23:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645100#M2124</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T03:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: replace data sources script not returning to for loop</title>
      <link>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645101#M2125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: cgnadinger&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working on this right now and was having issues with the Database Connection to our servers. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is working for the initial layer but I'm struggling with additional layers .. but it's progress further than where I was at least.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you're still interested, I took this a little farther, maybe overkill but...&lt;BR /&gt;&lt;BR /&gt;It will use a text file for input or from command line. It will also walk a directory structure.&lt;BR /&gt;&lt;BR /&gt;c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --help to see the options.&lt;BR /&gt;&lt;BR /&gt;Text file looks like:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# Layername or Source, Layername or SourcePath, Connect To, Featureclass
Layername,Artwork,Database Connections\PublicUser.sde,SDE.Artwork
Source,C:\Documents and Settings\user\Application Data\ESRI\ArcCatalog\publicuser.sde\SDE.BaseMap\SDE.Call_Box,Database Connections\user.sde,SDE.Call_Box
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Syntax for file input would be:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --dirpath c:\temp --norecurse --infile c:\temp\replace.txt --filelist c:\temp\test.mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Syntax for command line would be:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
c:\Temp&amp;gt;cls &amp;amp;&amp;amp; python changedatasource.py --dirpath c:\temp --norecurse --filelist c:\temp\test.mxd --dest "Layername,Artwork,Database Connections\PublicUser.sd
e,SDE.Artwork" --force
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;A note about the sample syntax. If --filelist is specified, --dirpath and --norecurse are ignored.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:23:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645101#M2125</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T03:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: replace data sources script not returning to for loop</title>
      <link>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645102#M2126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any help someone could give me would by most appreciated! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've replied with a few kinks I'm having here .. &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/49038-replaceDataSource-connecting-to-SDE-Instance?p=168862&amp;amp;viewfull=1#post168862"&gt;http://forums.arcgis.com/threads/49038-replaceDataSource-connecting-to-SDE-Instance?p=168862&amp;amp;viewfull=1#post168862&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 13:56:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/replace-data-sources-script-not-returning-to-for/m-p/645102#M2126</guid>
      <dc:creator>ChristinaGnadinger</dc:creator>
      <dc:date>2012-02-02T13:56:40Z</dc:date>
    </item>
  </channel>
</rss>

