<?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: How to split a field into multiple rows with python based on first upper case letter in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256304#M26697</link>
    <description>&lt;P&gt;in python ...&lt;EM&gt; yourstring&lt;/EM&gt;&lt;SPAN&gt;.upper()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ps you are missing a&amp;nbsp; closing ] on line 17&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[x.split(" ") for x in row[0]]  # -- added ]&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 08 Feb 2023 21:33:11 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2023-02-08T21:33:11Z</dc:date>
    <item>
      <title>How to split a field into multiple rows with python based on first upper case letter</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256258#M26696</link>
      <description>&lt;P&gt;I have a table with multiple rows, row a and row b. Row a has several species names separated by an enter key and a capital letter. I want to separate each species into its own row, and replicate row b. Here is the code I'm using, but I'm not sure how to make it upper case.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import os
import sys
from arcpy import env
from arcpy.sa import Con
from arcpy.sa import *

SC_table = r'D:\Data\Biological\SC\SC 2022\SC_2022.gdb\SC_table_2023'
new_sc_table = r'D:\Analysis\Biological_Update\Occurrences_Updates\December_2022_Updates\OUTPUT\Species_TablesbyState_2022.gdb\SC_table_Schema_2023'

searchC = arcpy.da.SearchCursor(SC_table, ("spp_list", "HUC12"))  # plus other attribute if you need

insertC = arcpy.da.InsertCursor(new_sc_table, ("spp_list", "HUC12"))

for row in searchC:
    print(row[0])
    A = [x.split(" ") for x in row[0]

    for i in range(min(len(A[0]), len(A[1]))):
        newRow = [A[0][i], A[1][i]]
        insertC.insertRow(newRow)
del insertC&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 20:15:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256258#M26696</guid>
      <dc:creator>KathleenHoenke</dc:creator>
      <dc:date>2023-02-08T20:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple rows with python based on first upper case letter</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256304#M26697</link>
      <description>&lt;P&gt;in python ...&lt;EM&gt; yourstring&lt;/EM&gt;&lt;SPAN&gt;.upper()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ps you are missing a&amp;nbsp; closing ] on line 17&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[x.split(" ") for x in row[0]]  # -- added ]&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Feb 2023 21:33:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256304#M26697</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-02-08T21:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple rows with python based on first upper case letter</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256392#M26698</link>
      <description>&lt;P&gt;Thank you! Sorry, how can that be integrated into the script above?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 02:57:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256392#M26698</guid>
      <dc:creator>KathleenHoenke</dc:creator>
      <dc:date>2023-02-09T02:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple rows with python based on first upper case letter</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256441#M26699</link>
      <description>&lt;P&gt;perhaps showing a typical input and desired output would help, but as a guess for now&lt;/P&gt;&lt;LI-CODE lang="python"&gt;r = ["row0 value here"]

[(x.upper()).split(" ") for x in r]
# -- yields
[['ROW0', 'VALUE', 'HERE']]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Feb 2023 10:56:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1256441#M26699</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-02-09T10:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple rows with python based on first upper case letter</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1257109#M26707</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/107488"&gt;@KathleenHoenke&lt;/a&gt;&amp;nbsp;Would this code snip help you?&amp;nbsp; It finds words in a string that start with capital leters.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import re
text = "HelloWorldHowAreYou"
# Regular expression pattern to split the string using capital letters
pattern = r"[A-Z][a-z]*"
result = re.findall(pattern, text)
print(result) #['Hello', 'World', 'How', 'Are', 'You']&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Feb 2023 17:19:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-split-a-field-into-multiple-rows-with/m-p/1257109#M26707</guid>
      <dc:creator>JonathanNeal</dc:creator>
      <dc:date>2023-02-10T17:19:17Z</dc:date>
    </item>
  </channel>
</rss>

