<?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: \f (form-feed) interfering with file names in code in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226605#M737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Two helpful links&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000000r000000"&gt;Arc 10 help: Setting paths to data in Python&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://docs.python.org/library/os.path.html"&gt;os.path&lt;/A&gt; is very useful for manipulating path strings&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jul 2012 16:11:54 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2012-07-03T16:11:54Z</dc:date>
    <item>
      <title>\f (form-feed) interfering with file names in code</title>
      <link>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226603#M735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: MCline19&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a functioning code block, which utilizes a list to input file names to be processed.&amp;nbsp; I have enountered an issue I do not know how to resolve.&amp;nbsp; The list of files I am currently trying to process has "\f" within the file names (see list code below).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;sdeFiles = ['G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.Apartments','G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.CE_Areas','G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.Fire_Grid','G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.Fire_Stations','G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.Mall','G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.PostOak_Mall','G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.PrePlan\fire.FIRE.Buildings','G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.PrePlan\fire.FIRE.Hydrants','G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.PrePlan\fire.FIRE.Points']&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The presence of "\f" within the file name returns errors when attempting to use the file, because it changes the file name to appear like the following example:&amp;nbsp; 'G:\\Department Projects\\Fire\\Fire DA_DC.sde\x0cire.FIRE.Apartments'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have looked up the issue.&amp;nbsp; /f has something to do with form-feed and moving printing positions.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to find someway around this.&amp;nbsp; I have tried changing the file name in my list to contain // rather than \; however, this returned an error stating the file did not exist.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas or solutions would be greatly appreciated.&amp;nbsp; THANKS!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 15:48:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226603#M735</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-07-03T15:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: \f (form-feed) interfering with file names in code</title>
      <link>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226604#M736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: NobbirAhmed&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use the backslash as path separator then make your string a raw string just by putting a 'r' in front like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;r'G:\Department Projects\Fire\Fire DA_DC.sde\fire.FIRE.Apartments'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 15:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226604#M736</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-07-03T15:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: \f (form-feed) interfering with file names in code</title>
      <link>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226605#M737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Two helpful links&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000000r000000"&gt;Arc 10 help: Setting paths to data in Python&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://docs.python.org/library/os.path.html"&gt;os.path&lt;/A&gt; is very useful for manipulating path strings&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 16:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226605#M737</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-07-03T16:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: \f (form-feed) interfering with file names in code</title>
      <link>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226606#M738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: MCline19&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&amp;nbsp; Both responses help.&amp;nbsp; I do have 1 more question though.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When my script is complete, I need it to delete some temporary files that were created in the process; however, I am getting an error.&amp;nbsp; When my script runs, it opens the final files it creates in ArcMap and in order to delete the temporary files, I think I need to close the opened files.&amp;nbsp; My script is below, with the delete portion and errors being at the bottom:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
sdeFiles = ['G:\Department Projects\Development Services\Dev Services DA_DC.sde\dev_services.DEVSERV.Aerial_monuments1994']
print ("Beginning .sde to .shp file converstion")
for x in sdeFiles:
 n = x.split('.')[-1]
 arcpy.FeatureClassToShapefile_conversion(x,'G:\GISAdmin\SDE_Backups\NewTempShapefiles')
 extension = n + '.shp'
 newFile = 'G://GISAdmin//SDE_Backups//NewTempShapefiles//' + extension
 backupFile = 'G://GISAdmin//SDE_Backups//BackupFiles//' + extension
 print ("Beginning feature compare")
 if arcpy.Exists(backupFile):
&amp;nbsp; arcpy.FeatureCompare_management(newFile,backupFile, 'FID')
 else: 
&amp;nbsp; arcpy.CopyFeatures_management(newFile,backupFile)
&amp;nbsp; print ("Beginning backup")
&amp;nbsp; if newFile == backupFile: 
&amp;nbsp;&amp;nbsp; pass 
&amp;nbsp; elif arcpy.Exists(backupFile):
&amp;nbsp;&amp;nbsp; arcpy.management.Delete(backupFile) and arcpy.CopyFeatures_management(newFile,backupFile)
print ("Backup complete")
for x in sdeFiles:
 arcpy.management.Delete(x)
 #Getting error 000464: Cannot get exclusive schema look.&amp;nbsp; Either being edited or in use by another applicaiton.&amp;nbsp; Failed to execute (Delete).
print "Temporary files deleted"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advise on how to close and delete would be great!&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:02:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/f-form-feed-interfering-with-file-names-in-code/m-p/226606#M738</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T11:02:11Z</dc:date>
    </item>
  </channel>
</rss>

