<?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: Dynamic Text - limiting characters to document name in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/dynamic-text-limiting-characters-to-document-name/m-p/47197#M3774</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could also use slicing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
x = "abc123-file.mxd"

# First 6 characters
print x[0:6]
&amp;gt;&amp;gt; abc123

# First 6 characters plus .mxd
print x[0:6]+".mxd"
&amp;gt;&amp;gt; abc123.mxd
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:50:10 GMT</pubDate>
    <dc:creator>RDHarles</dc:creator>
    <dc:date>2021-12-10T21:50:10Z</dc:date>
    <item>
      <title>Dynamic Text - limiting characters to document name</title>
      <link>https://community.esri.com/t5/python-questions/dynamic-text-limiting-characters-to-document-name/m-p/47195#M3772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've searched through the forum and couldn't find a similar question so apologies if this has already been answered before.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Within arcmap 10 looking at creating a specific map document id to display on the map layout made up of (first part of document name/company code/number field)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its the first part of this id that i can not figure out. Example of a document name is abc123-file.mxd. What i would like to display is only abc123. Is there a way to amend the document name scripting to recognise the first part of the document name?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 23:22:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamic-text-limiting-characters-to-document-name/m-p/47195#M3772</guid>
      <dc:creator>RussellPilbeam</dc:creator>
      <dc:date>2011-06-14T23:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - limiting characters to document name</title>
      <link>https://community.esri.com/t5/python-questions/dynamic-text-limiting-characters-to-document-name/m-p/47196#M3773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Assuming that the hyphen is always the separator that you're using, you can do it with the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;filename&lt;/SPAN&gt;&lt;SPAN&gt;.split('-')[0]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 11:00:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamic-text-limiting-characters-to-document-name/m-p/47196#M3773</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2011-06-15T11:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - limiting characters to document name</title>
      <link>https://community.esri.com/t5/python-questions/dynamic-text-limiting-characters-to-document-name/m-p/47197#M3774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could also use slicing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
x = "abc123-file.mxd"

# First 6 characters
print x[0:6]
&amp;gt;&amp;gt; abc123

# First 6 characters plus .mxd
print x[0:6]+".mxd"
&amp;gt;&amp;gt; abc123.mxd
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:50:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamic-text-limiting-characters-to-document-name/m-p/47197#M3774</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2021-12-10T21:50:10Z</dc:date>
    </item>
  </channel>
</rss>

