<?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: Join multiple tables to multiple feature classes arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181556#M13969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oops... should be :&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;tableNum &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; table &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="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;good catch. Your approach works just as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at&amp;nbsp;&lt;A class="link-titled" href="https://developers.google.com/edu/python/strings" title="https://developers.google.com/edu/python/strings"&gt;Python Strings &amp;nbsp;|&amp;nbsp; Python Education &amp;nbsp;|&amp;nbsp; Google Developers&lt;/A&gt;&amp;nbsp;&amp;nbsp;and the 'Hello' example&amp;nbsp;of string slices....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2020 21:22:25 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2020-03-31T21:22:25Z</dc:date>
    <item>
      <title>Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181549#M13962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Hello,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I need help to create a script that would allow me to loop through multiple tables in a geodatabase and join them to the correct feature class in another geodatabase. There are in total 77 tables and 77 feature classes. I would tell GIS to join those where a portion of the table name matches a portion of the Feature class name.&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;For example:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Table Name 1: "NAL&lt;STRONG&gt;11&lt;/STRONG&gt;F201901"&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Feature class 1: "T&lt;STRONG&gt;11&lt;/STRONG&gt;"&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Table Name 2: "NAL&lt;STRONG&gt;12&lt;/STRONG&gt;F201901&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Feature Class 2: "T&lt;STRONG&gt;12&lt;/STRONG&gt;"&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Important:&lt;/P&gt;&lt;UL&gt;&lt;LI style="background-color: #ffffff; border: 0px;"&gt;All of the tables and the feature classes have the same unique field name.&amp;nbsp;&lt;/LI&gt;&lt;LI style="background-color: #ffffff; border: 0px;"&gt;I need to join all of the fields.&amp;nbsp;&lt;/LI&gt;&lt;LI style="background-color: #ffffff; border: 0px;"&gt;The join needs to be permanent.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if Add join is better to use or if I should use Join field.&lt;/P&gt;&lt;P&gt;I don't really know what to do next.&lt;/P&gt;&lt;P&gt;I would really appreciate any help with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

in_features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\APRX_MXDS\USA_Parcels_2019_Project\Florida_Parcels_Per_County_Final.gdb"&lt;/SPAN&gt;
join_tables &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\APRX_MXDS\USA_Parcels_2019_Project\Florida_Property_Data_Per_County.gdb"&lt;/SPAN&gt;

list_infeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFeatureClasses&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
list_join_tables &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListTables&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;NAL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
UniqueField &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CO_PARCELID"&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; fc &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; list_infeatures&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddJoin_management&lt;SPAN class="punctuation token"&gt;(&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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:16:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181549#M13962</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2021-12-11T09:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181550#M13963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll start the discussion with this little tidbit from the help pages:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;The workspace environment must be set before using several of the &lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listtables.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;list functions,&lt;/A&gt; including&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-size: 17px;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listdatasets.htm" style="color: #0074b8; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;ListDatasets&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-size: 17px;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm" style="color: #0074b8; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;ListFeatureClasses&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-size: 17px;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listfiles.htm" style="color: #0074b8; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;ListFiles&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-size: 17px;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listrasters.htm" style="color: #0074b8; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;ListRasters&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-size: 17px;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listtables.htm" style="color: #0074b8; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;ListTables&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;, and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-size: 17px;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listworkspaces.htm" style="color: #0074b8; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;ListWorkspaces&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Your variables mentioned in lines will only return the path to each of the respective databases.&amp;nbsp; Try it with a print() statement,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Given the limitation of the list functions, you want to work things a little differently in order to get what you want.&amp;nbsp; Something like this might work for you: (&lt;EM&gt;&lt;STRONG&gt;completely untested: run it on some backup data first!&lt;/STRONG&gt;&lt;/EM&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

featureGDB &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\APRX_MXDS\USA_Parcels_2019_Project\Florida_Parcels_Per_County_Final.gdb"&lt;/SPAN&gt;
tableGDB &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\APRX_MXDS\USA_Parcels_2019_Project\Florida_Property_Data_Per_County.gdb"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featureGDB
featureWS &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featureGDB
featureList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFeatureClasses&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tableGDB
tableList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListTables&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
tableWS&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tableGDB



&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; table &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; tableList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    tableNum &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; table &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="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; feature &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; featureList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; feature &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; f&lt;SPAN class="string token"&gt;'T{tableNum}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            inData &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; f&lt;SPAN class="string token"&gt;'{featureWS}\\{feature}'&lt;/SPAN&gt;
            inField &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'the join field name in the feature class'&lt;/SPAN&gt;
            joinTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; f&lt;SPAN class="string token"&gt;'{tableWS}\\{table}'&lt;/SPAN&gt;
            joinField &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'the join field name in the table'&lt;/SPAN&gt;
            arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;JoinField&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inData&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; inField&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; joinTable&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; joinField&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;/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;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;/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;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;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;This makes a couple of assumptions: the table names are just who you showed them and the feature class names are just how you showed them.&amp;nbsp; It also assumes you want to join the table data into the appropriate feature class.&amp;nbsp; According to to &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/join-field.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Join Field help doc&lt;/A&gt;&amp;nbsp;this will be a permanent join to the feature class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Hope this helps-&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:16:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181550#M13963</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T09:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181551#M13964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Joe for your help!&lt;/P&gt;&lt;P&gt;I am internally fixing something I found before I am able to run the script.&lt;/P&gt;&lt;P&gt;I have two questions in regards to the script:&lt;/P&gt;&lt;P&gt;1. Line 16: You created a variable called tableNum = table [3:7]. Arcpy recognizes that everytime you write table that is in fact calling a table in GIS? How does python know that we are in fact calling a table in GIS?&lt;/P&gt;&lt;P&gt;2. what do the \\ do to the f' strings?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 20:28:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181551#M13964</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-03-31T20:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181552#M13965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Line # 18 is saying:&amp;nbsp;&lt;/P&gt;&lt;P&gt;if the name of the feature class is the same as the name of the table: T{tableNum} then, join them.&lt;/P&gt;&lt;P&gt;But as you can see above the name of the feature class is T11, T12, T13 etc...&lt;/P&gt;&lt;P&gt;and the name on the tables start with NAL and then have the number. Whenever the number matches, then the join must happen.&lt;/P&gt;&lt;P&gt;I am not sure if this is what the code says.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 20:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181552#M13965</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-03-31T20:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181553#M13966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;EM&gt;&lt;STRONG&gt;Line 16: You created a variable called tableNum = table [3:7]. Arcpy recognizes that everytime you write table that is in fact calling a table in GIS? How does python know that we are in fact calling a table in GIS?&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;With each pass through the tableList, I get a value for table and then I strip out the number that appears in that table name. I use that number to identify the feature class to join to.&amp;nbsp; That's why the assumption that all you table names follow the same convention as well as the feature classes. If you have any of either that do not follow the convention in your original post, we have another problem to solve.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;what do the \\ do to the f' strings?&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; &amp;nbsp;It may be overkill, but with I'm escaping the second backslash with the first backslash. A&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pythonconquerstheuniverse.wordpress.com/2008/06/04/gotcha-%E2%80%94-backslashes-are-escape-characters/" style="color: #2989c5; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;backslash is a special character in pytho&lt;/A&gt;n and I want a lit&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;eral backslash as part of the path. I just checked and it'll work with or without:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\temp'&lt;/SPAN&gt;

file &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'xyz'&lt;/SPAN&gt;

newPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; f&lt;SPAN class="string token"&gt;'{path}\{file}'&lt;/SPAN&gt;

newPath
Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C:\\temp\\xyz'&lt;/SPAN&gt;

newPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; f&lt;SPAN class="string token"&gt;'{path}\\{file}'&lt;/SPAN&gt;

newPath
Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C:\\temp\\xyz'&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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It acts like the &lt;A href="https://www.geeksforgeeks.org/python-os-path-join-method/" rel="nofollow noopener noreferrer" target="_blank"&gt;os.path.join() method&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:16:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181553#M13966</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T09:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181554#M13967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lines 18 and 19 work together.&amp;nbsp; Again, I've made the assumption that your featureList looks like:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'T11'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'T12'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'T13'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#and so on...&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The first for loop at line 16 gets us the table name in the form of&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;"NAL&lt;/SPAN&gt;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;12&lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff;"&gt;F201901".&amp;nbsp; But that's we have; just the name.&amp;nbsp; Since you have your tables and feature classes in different workspaces, we have to accommodate for that fact.&amp;nbsp;&amp;nbsp;In line 17 &lt;EM&gt;&lt;STRONG&gt;we get just the number part of the table name&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp;At line 18 we scan the featureList for an element which is T along with the number from the tableName. Line 19 says:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; feature &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; f&lt;SPAN class="string token"&gt;'T{tableNum}'&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in f strings, you enclose the variable name, and hence it's current value with the curly braces. If line 16 gives us 'NAL12F201901' as the value of variable table, the value of variable tableNum is 12.&amp;nbsp; Consequently, the feature we are going to work with is T12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I suggest you create a couple of lists, one of table names and one of feature classes.&amp;nbsp; Try my logic but don't worry about the arcpy stuff.&amp;nbsp; Just use straight.&amp;nbsp; I like to do this sort of thing in the Spyder ide because you can highlight the given text in the script window and with F9, execute it in the console window.&amp;nbsp; Use print() statements along the way to expose your variable names....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:06:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181554#M13967</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-03-31T21:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181555#M13968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect Joe, I understand and I will try it as you suggest with the print statements to better see what I am doing.&lt;/P&gt;&lt;P&gt;Before I do that I have one last question though .. in line 17 we are using slicing right:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;tableNum &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; table &lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit;"&gt;3&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit;"&gt;7&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;] 
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;would 3 to 7 give us: 11F2 ?&lt;/P&gt;&lt;P&gt;wouldn't it be [3:5] ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if I am being stubborn, I really want to understand it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:16:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181555#M13968</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2021-12-11T09:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181556#M13969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oops... should be :&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;tableNum &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; table &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="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;good catch. Your approach works just as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at&amp;nbsp;&lt;A class="link-titled" href="https://developers.google.com/edu/python/strings" title="https://developers.google.com/edu/python/strings"&gt;Python Strings &amp;nbsp;|&amp;nbsp; Python Education &amp;nbsp;|&amp;nbsp; Google Developers&lt;/A&gt;&amp;nbsp;&amp;nbsp;and the 'Hello' example&amp;nbsp;of string slices....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:22:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181556#M13969</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-03-31T21:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181557#M13970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great thanks!! I will run the code in a little bit. Will let you know how that goes &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:28:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181557#M13970</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-03-31T21:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181558#M13971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The slice thing is just how my brain works: I slice off the first few characters and then work my way back from the end to slice&amp;nbsp;off the excess. That's what's cool about python; several&amp;nbsp;means to the same end...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181558#M13971</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-03-31T21:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181559#M13972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe, the code worked!! &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;I am so happy! thank you so much! I was really stuck and needed to do this automatically. I used to do all of this manually for such a long time and I am learning to automate this with your help and with as many videos I can find online.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, do you know of a good course that would teach me python applied to arcgis ? All I find are separate videos each one teaching different things. I would love to find something that goes from the very beginning until more advanced processes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways.. thank you again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:50:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181559#M13972</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-03-31T21:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181560#M13973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm glad it worked.&amp;nbsp; There is an instructor lead esri course; I took it it some time back. It was okay.&amp;nbsp; I've mostly just picked it up on my own with a lot of help from this forum.&amp;nbsp; Using ArcGIS Pro you can run a tool, get the syntax figured out and then create a stand alone script based on that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are lots of on-line python tutorials.&amp;nbsp; I like the &lt;A href="https://www.w3schools.com/python/"&gt;w3schools&lt;/A&gt; stuff as they spell&amp;nbsp;things&amp;nbsp;out pretty succinctly. Python documentation is all over the web, so if just preface a question with 'python' you can usually find what you are looking for like 'python return last 7 letters in a string' or 'python for loop' or 'python if else'.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 22:24:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181560#M13973</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-03-31T22:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple tables to multiple feature classes arcpy</title>
      <link>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181561#M13974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you again! Will keep on learning and using the online tools&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 23:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-multiple-tables-to-multiple-feature-classes/m-p/181561#M13974</guid>
      <dc:creator>NataliaGutierrez1</dc:creator>
      <dc:date>2020-03-31T23:38:27Z</dc:date>
    </item>
  </channel>
</rss>

