<?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: Parts ofa file name to become a field string. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522280#M40940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;sorry i should have clarified. I'm trying to run this through arc catalog rather than arcmap. The end state of this is a custom tool for the ArcToolBox. Any ideas on that?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jul 2012 01:05:58 GMT</pubDate>
    <dc:creator>PatrickFischer1</dc:creator>
    <dc:date>2012-07-03T01:05:58Z</dc:date>
    <item>
      <title>Parts ofa file name to become a field string.</title>
      <link>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522276#M40936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a script that takes an MXD and makes a polygon of the outline of the Main Dataframe and has some metadata added to the fields. All of my MXD's have a product ID as their file name. I also have a field named product ID. Is there a way to make the string that is calculated into my Product ID field be populated by the name of the MXD? Is there also a way to take out certain parts of a file name, as my Product ID has other information such as Area Covered, Product Type, Edition, ETC?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jun 2012 07:16:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522276#M40936</guid>
      <dc:creator>PatrickFischer1</dc:creator>
      <dc:date>2012-06-02T07:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Parts ofa file name to become a field string.</title>
      <link>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522277#M40937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try Calculate Field gp tool. Extract the product ID from map document's name and set it to the ProductID field. Follow this topic if you need help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Calculate_Field/00170000004m000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Calculate_Field/00170000004m000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 06:06:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522277#M40937</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2012-06-04T06:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Parts ofa file name to become a field string.</title>
      <link>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522278#M40938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried that. However i also have an export of my product in the same folder as a pdf for dissemination purposes. When i ran the split text it gives me both then i added *.mxd and it would always return an error for me when trying to use it as a label. Do i need to turn it into a string via GetParameter?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2012 07:18:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522278#M40938</guid>
      <dc:creator>PatrickFischer1</dc:creator>
      <dc:date>2012-07-02T07:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Parts ofa file name to become a field string.</title>
      <link>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522279#M40939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's an example how you can put ArcMap project filename into attribute value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In Field Calculator Pre-Logic Scrip Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def projName():
&amp;nbsp; import os
&amp;nbsp; mxdPath = arcpy.mapping.MapDocument("CURRENT").filePath
&amp;nbsp; filePath, fileExt = os.path.splitext(mxdPath)
&amp;nbsp; fileName = os.path.basename(filePath)
&amp;nbsp; return fileName&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ProjName = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;projName()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]15649[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to do this in standalone script use arcpy.CalculateField_management() to calculate field values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:46:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522279#M40939</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2021-12-11T22:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Parts ofa file name to become a field string.</title>
      <link>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522280#M40940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;sorry i should have clarified. I'm trying to run this through arc catalog rather than arcmap. The end state of this is a custom tool for the ArcToolBox. Any ideas on that?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 01:05:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parts-ofa-file-name-to-become-a-field-string/m-p/522280#M40940</guid>
      <dc:creator>PatrickFischer1</dc:creator>
      <dc:date>2012-07-03T01:05:58Z</dc:date>
    </item>
  </channel>
</rss>

