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.
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