<?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: Return partial file path in dynamic text in ArcGIS Enterprise Portal Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691758#M9377</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if this will help in your context but with python you could use the split &amp;amp; join methods...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pth = "c:/aaaa/bbbb/cccc/Project_X/SubFolderY/Some.mxd"
&amp;gt;&amp;gt;&amp;gt; mxdId = pth.split("/")
&amp;gt;&amp;gt;&amp;gt; mxdId
['c:', 'aaaa', 'bbbb', 'cccc', 'Project_X', 'SubFolderY', 'Some.mxd']
&amp;gt;&amp;gt;&amp;gt; mxdId[-3:]
['Project_X', 'SubFolderY', 'Some.mxd']
&amp;gt;&amp;gt;&amp;gt; mxdIdSub = "/".join(mxdId[-3:])
&amp;gt;&amp;gt;&amp;gt; mxdIdSub
'Project_X/SubFolderY/Some.mxd'
&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would have to provide some other logic to identify where you need only the last 2 parts (no sub folder).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:06:56 GMT</pubDate>
    <dc:creator>NeilAyres</dc:creator>
    <dc:date>2021-12-12T05:06:56Z</dc:date>
    <item>
      <title>Return partial file path in dynamic text</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691757#M9376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Investigating some automation of our maps and want to put the mxd file location on the map. All our mxds are stored in folder (+/- subfolders) with the folders 5 deep in the file path e.g. mxd might be in&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G:\aaaa\bbbb\cccc\dddd\eeee\BASE_FOLDER\SUBFOLDER\mxd_name &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where there will always be the BASE_FOLDER which is a project identifier - the SUBFOLDER part might exist for a major project but not for all projects. I can insert the full path as dynamic text, but would prefer to NOT SHOW the part &lt;STRONG&gt;G:\aaaa\bbbb\cccc\dddd\eeee\&lt;/STRONG&gt;. There will always be the same number of nested folders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone offer any solutions (even if it is a hack).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 05:29:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691757#M9376</guid>
      <dc:creator>MarkFawkes</dc:creator>
      <dc:date>2015-07-22T05:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Return partial file path in dynamic text</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691758#M9377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if this will help in your context but with python you could use the split &amp;amp; join methods...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pth = "c:/aaaa/bbbb/cccc/Project_X/SubFolderY/Some.mxd"
&amp;gt;&amp;gt;&amp;gt; mxdId = pth.split("/")
&amp;gt;&amp;gt;&amp;gt; mxdId
['c:', 'aaaa', 'bbbb', 'cccc', 'Project_X', 'SubFolderY', 'Some.mxd']
&amp;gt;&amp;gt;&amp;gt; mxdId[-3:]
['Project_X', 'SubFolderY', 'Some.mxd']
&amp;gt;&amp;gt;&amp;gt; mxdIdSub = "/".join(mxdId[-3:])
&amp;gt;&amp;gt;&amp;gt; mxdIdSub
'Project_X/SubFolderY/Some.mxd'
&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would have to provide some other logic to identify where you need only the last 2 parts (no sub folder).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:06:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691758#M9377</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-12T05:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Return partial file path in dynamic text</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691759#M9378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Neil&lt;/P&gt;&lt;P&gt;Took the easy way out and have decided to change our mxd naming convention to include the info I wanted. Easier to use dynamic text to just add the mxd name than try and parse the file path.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 12:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691759#M9378</guid>
      <dc:creator>MarkFawkes</dc:creator>
      <dc:date>2015-08-22T12:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Return partial file path in dynamic text</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691760#M9379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a serious need for us. We generate so many maps, and need to quickly find the maps from [last year, last quarter] to make the exact same map again with one change in less than one hour..... so the dynamic text is crucial to our productivity and turnaround time. Can a custom dynamic text code be used in our organization ?? Is this possible?&lt;/P&gt;&lt;P&gt;Can the default folder dynamic text be forced to return just the left 75 characters?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kudos to anyone who can solve this!&amp;nbsp;&lt;/P&gt;&lt;P&gt;dynamic text format‌&amp;nbsp;arcpro&amp;nbsp;template customization&amp;nbsp;&lt;A href="https://community.esri.com/space/2151"&gt;ArcGIS Pro&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2019 14:40:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/return-partial-file-path-in-dynamic-text/m-p/691760#M9379</guid>
      <dc:creator>AmyGwin2</dc:creator>
      <dc:date>2019-09-27T14:40:19Z</dc:date>
    </item>
  </channel>
</rss>

