<?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: Joining attribute table to excel sheet in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401500#M31631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;So what i want is the "name" field to be the same as "GPS_Coordi" field, but i cant use those field to do the joining without doing some changes because there is some spelling error such as removing the middle values(12345/&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #e23d39;"&gt;6578&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;/ST/1), adding "/" after ST, changing the lower case to upper case(st to ST), and removing spaces between values.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you have answered you own question with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;but i cant use those field to do the joining without doing some changes because there is some spelling error such as removing the middle"&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;Since those are basically the common unique field, but with slightly different formatting, I would suggest making a new field in each file and formatting or calculating the code to make those equivalent.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;Since the "name" field does not always contain a valid GPS coordinate it would be hard to do a spatial join &lt;EM&gt;&lt;STRONG&gt;unless&lt;/STRONG&gt;&lt;/EM&gt; you have propery xy coordinate in field that isn't in your graphic, in which case you create an event theme etc. But if you dont, the unique field creation may be your only option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;there are others on this forum that are faster at providing string formatting code than me....i'll leave it to them to provide suggestions.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Mar 2016 10:44:20 GMT</pubDate>
    <dc:creator>RebeccaStrauch__GISP</dc:creator>
    <dc:date>2016-03-10T10:44:20Z</dc:date>
    <item>
      <title>Joining attribute table to excel sheet</title>
      <link>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401499#M31630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;I want to add a column in my dbase file which will have geometry data (Area)&amp;nbsp; by joining the dbase file with attribute table.&lt;/P&gt;&lt;P&gt;I have tried to use "FARMER_UNI" from my dbase file to join with "FARMER_UNI" from my attribute table, but the result were not what i wanted.below is an attribute table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.JPG" class="image-1 jive-image" height="426" src="https://community.esri.com/legacyfs/online/190534_1.JPG" style="height: 431px; width: 767.874px;" width="758" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is the results i get,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2.JPG" class="image-2 jive-image" height="412" src="https://community.esri.com/legacyfs/online/190562_2.JPG" style="height: 430px; width: 772.754px;" width="741" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what i want is the "name" field to be the same as "GPS_Coordi" field, but i cant use those field to do the joining without doing some changes because there is some spelling error such as removing the middle values(12345/&lt;SPAN style="color: #e23d39;"&gt;6578&lt;/SPAN&gt;/ST/1), adding "/" after ST, changing the lower case to upper case(st to ST), and removing spaces between values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With thanks!&lt;/P&gt;&lt;P&gt;Kelvin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 09:39:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401499#M31630</guid>
      <dc:creator>KelvinMwakomo</dc:creator>
      <dc:date>2016-03-10T09:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Joining attribute table to excel sheet</title>
      <link>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401500#M31631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;So what i want is the "name" field to be the same as "GPS_Coordi" field, but i cant use those field to do the joining without doing some changes because there is some spelling error such as removing the middle values(12345/&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #e23d39;"&gt;6578&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;/ST/1), adding "/" after ST, changing the lower case to upper case(st to ST), and removing spaces between values.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you have answered you own question with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;but i cant use those field to do the joining without doing some changes because there is some spelling error such as removing the middle"&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;Since those are basically the common unique field, but with slightly different formatting, I would suggest making a new field in each file and formatting or calculating the code to make those equivalent.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;Since the "name" field does not always contain a valid GPS coordinate it would be hard to do a spatial join &lt;EM&gt;&lt;STRONG&gt;unless&lt;/STRONG&gt;&lt;/EM&gt; you have propery xy coordinate in field that isn't in your graphic, in which case you create an event theme etc. But if you dont, the unique field creation may be your only option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;there are others on this forum that are faster at providing string formatting code than me....i'll leave it to them to provide suggestions.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 10:44:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401500#M31631</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-03-10T10:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Joining attribute table to excel sheet</title>
      <link>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401501#M31632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rebecca,&lt;/P&gt;&lt;P&gt;I am also looking for a field calculator expression which can help me to rectify those error, because i have a lot of data if i edit manually it can take days to complete.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 10:56:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401501#M31632</guid>
      <dc:creator>KelvinMwakomo</dc:creator>
      <dc:date>2016-03-10T10:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Joining attribute table to excel sheet</title>
      <link>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401502#M31633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you will have to add a new field&lt;/P&gt;&lt;P&gt;Python parser&lt;/P&gt;&lt;P&gt;new field:&amp;nbsp; FarmerTxt&amp;nbsp;&amp;nbsp; make it text with an appropriate width&lt;/P&gt;&lt;P&gt;then in the new field do&lt;/P&gt;&lt;P&gt;str(!UniqueNo*!)&amp;nbsp; or whatever the field is&lt;/P&gt;&lt;P&gt;So basically you are converting the unique numbers into text&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 11:26:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401502#M31633</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-10T11:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Joining attribute table to excel sheet</title>
      <link>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401503#M31634</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;But what i need now is to create a field both in a Table and dbase file which can have the values of "name" field,without the middle number eg.(181073/ST/1) instead of (181073/23792/ST/1), Also for the cases like 181073/23792/st1,181073/23792/st 1,181073/23792/ST/01 to become 181073/ST/1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kelvin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 12:26:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401503#M31634</guid>
      <dc:creator>KelvinMwakomo</dc:creator>
      <dc:date>2016-03-10T12:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Joining attribute table to excel sheet</title>
      <link>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401504#M31635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if this is a different question you should mark the answer that provide a solution correct.. then start a new question, otherwise the thread will become a long thread of needs that bear no relationship to the initial thread title.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 13:24:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401504#M31635</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-10T13:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Joining attribute table to excel sheet</title>
      <link>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401505#M31636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is that all you have to worry about(because I'm guessing there's more)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open your python interpretor and play with your various values till you start getting the desired result&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; a = '181073/23792/ST/1'&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; b = a.split('/')&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; b[1]&lt;/P&gt;&lt;P&gt;'23792'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is a list of your examples and they all produce the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = ['181073/23792/ST/1',"181073/23792/st1","181073/23792/st","1,181073/23792/ST/01"]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#I'm walking through the list using the for statement. &lt;/P&gt;&lt;P&gt;#In field calculator you will not need to use for, you'll need each = str(!yourfield!)&lt;/P&gt;&lt;P&gt;for each in a:&lt;/P&gt;&lt;P&gt;&amp;nbsp; #The if statement is testing to see if there is a comma in your each variable&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ',' in each:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #So if there is a comma we will split the each variable into pieces. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #The number of pieces are based on the number of commas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; each = each.split(',')[-1]&lt;/P&gt;&lt;P&gt;&amp;nbsp; #Now we'll split either what's left from the if statement or the original each value&lt;/P&gt;&lt;P&gt;&amp;nbsp; each = each.split('/')[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp; #Now we'll add the proper ending back &lt;/P&gt;&lt;P&gt;&amp;nbsp; each = each + '/ST/1'&lt;/P&gt;&lt;P&gt;&amp;nbsp; #Finally we will print the value so we can see it.&lt;/P&gt;&lt;P&gt;&amp;nbsp; #In the field calculator you'll use the return statement&lt;/P&gt;&lt;P&gt;&amp;nbsp; #return each&lt;/P&gt;&lt;P&gt;&amp;nbsp; print each&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 13:59:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/joining-attribute-table-to-excel-sheet/m-p/401505#M31636</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-03-10T13:59:51Z</dc:date>
    </item>
  </channel>
</rss>

