<?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: Adding a field name and Parsing the filename in model builder in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833863#M1896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is an example of the filename that is being returned?&lt;/P&gt;&lt;P&gt;If it is a string, then there is not tool in arctoolbox to parse text, this can be done via a script or even a field calculator expression parsing the part you want.&amp;nbsp; For example to get the featureclass name from a full path in python you would use&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:/folder/file.gdb/featureclass"&lt;/SPAN&gt;

fn&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'featureclass'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where fn would be your filename&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:06:00 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-12T10:06:00Z</dc:date>
    <item>
      <title>Adding a field name and Parsing the filename in model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833858#M1891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a new field name to hold the filename of each table am iterating. I have used the parse path to collect the filename but and preconditioned the the parsing so that the field can be added first before the filename is populated in the new created field. When I run the model I an error that workspace not set for geoprocessor. Any help please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;IMG alt="" class="image-1 jive-image j-img-original" src="/legacyfs/online/406473_Model Builder.png" /&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2018 22:12:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833858#M1891</guid>
      <dc:creator>VincentOgodo</dc:creator>
      <dc:date>2018-05-14T22:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a field name and Parsing the filename in model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833859#M1892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this out :&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00626-00650-000638.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00626-00650-000638.htm"&gt;000638: Workspace not set for GeoProcessor.—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this:&amp;nbsp;&lt;A href="https://community.esri.com/thread/48342"&gt;https://community.esri.com/thread/48342&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't quite get through your models logic, but make sure you are accessing a fgdb and not a feature class.&amp;nbsp; A workspace 'holds' the feature or table, so a workspace can be a directory (folder) that has a shapefile or dbf table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2018 02:06:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833859#M1892</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-05-15T02:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a field name and Parsing the filename in model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833860#M1893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You really don't need the Parse Path step -- Name is&amp;nbsp;already parsed,&amp;nbsp;Name is the name of the table without any file extension.&amp;nbsp;You can simply use Name in your Calculate Field expression -- that is: "%Name%".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2018 04:21:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833860#M1893</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2018-05-15T04:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a field name and Parsing the filename in model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833861#M1894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This did not work. It created the field name but failed to populate the names. It resulted in empty records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2018 08:47:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833861#M1894</guid>
      <dc:creator>VincentOgodo</dc:creator>
      <dc:date>2018-05-15T08:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a field name and Parsing the filename in model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833862#M1895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I managed to overcome the problem and it works fine. The new problem I have now is how to select part(s) of the file names to be populated in to the new created field. As it is the whole file name is written but I just would like parts of the filename.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2018 08:50:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833862#M1895</guid>
      <dc:creator>VincentOgodo</dc:creator>
      <dc:date>2018-05-15T08:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a field name and Parsing the filename in model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833863#M1896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is an example of the filename that is being returned?&lt;/P&gt;&lt;P&gt;If it is a string, then there is not tool in arctoolbox to parse text, this can be done via a script or even a field calculator expression parsing the part you want.&amp;nbsp; For example to get the featureclass name from a full path in python you would use&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:/folder/file.gdb/featureclass"&lt;/SPAN&gt;

fn&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'featureclass'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where fn would be your filename&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:06:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833863#M1896</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T10:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a field name and Parsing the filename in model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833864#M1897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan,&lt;/P&gt;&lt;P&gt;Am actually dealing with Tables. The fieldname is a string e.g. et_2003-2004c12 where the last two digits are indicates month of december. 2003-2004 represents the years which I also want to extract out into a separate field. I am a dummy with scripting in python let alone programming strings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2018 09:04:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833864#M1897</guid>
      <dc:creator>VincentOgodo</dc:creator>
      <dc:date>2018-05-15T09:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a field name and Parsing the filename in model builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833865#M1898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your future reference... it is python 'slicing'&lt;/P&gt;&lt;DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;d &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"et_2003-2004c12"&lt;/SPAN&gt;
y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; d&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;12&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
m &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; d&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
d&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; m&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'et_2003-2004c12'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2003-2004'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'12'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:06:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/adding-a-field-name-and-parsing-the-filename-in/m-p/833865#M1898</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T10:06:03Z</dc:date>
    </item>
  </channel>
</rss>

