<?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: Can't update feature class from csv file in python script in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651618#M45746</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/695311"&gt;@GeorgeJonesRIGOV&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it be possible to print both the join_value and the csv_data? It could be that the join_value is not in the csv_data, the address could be null or none as well.&lt;/P&gt;&lt;P&gt;I would start placing some prints around that would allow for some debugging!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
    <pubDate>Thu, 18 Sep 2025 19:45:07 GMT</pubDate>
    <dc:creator>CodyPatterson</dc:creator>
    <dc:date>2025-09-18T19:45:07Z</dc:date>
    <item>
      <title>Can't update feature class from csv file in python script</title>
      <link>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651609#M45745</link>
      <description>&lt;P&gt;hi, all I've been trying to run a script to update a feature class but the message i get (part of the script) state "No matching values in CSV of join field: plus the value ". any advice? this is the script i have.&amp;nbsp; thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import csv&lt;BR /&gt;gdb_path = r'S:\PW\GIS\Map Requests\Water_MeterProject\MapProject_11x17\RIDVSQL.sde'&lt;BR /&gt;fc = r'S:\PW\GIS\Map Requests\Water_MeterProject\MapProject_11x17\RIDVSQL.sde\RIGIS.DBO.Water_Features\RIGIS.DBO.ResidentialWaterMeter'&lt;BR /&gt;csv_file = r'S:\PW\GIS\Map Requests\Water_MeterProject\Account Data 100124.csv'&lt;/P&gt;&lt;P&gt;#fields in fc to update&lt;BR /&gt;fc_fields = ['Address', 'SerialNumber']&lt;BR /&gt;#field in csv to update&lt;BR /&gt;csv_fields = ['service_address', 'serial_no']&lt;/P&gt;&lt;P&gt;csv_data = {}&lt;BR /&gt;with open(csv_file, 'r') as f:&lt;BR /&gt;reader = csv.DictReader(f)&lt;BR /&gt;for row in reader:&lt;BR /&gt;csv_data[row[csv_fields[0]]] = row&lt;BR /&gt;arcpy.env.workspace = gdb_path&lt;BR /&gt;edit = arcpy.da.Editor(gdb_path) #start edit session&lt;BR /&gt;edit.startEditing(False, True)&lt;BR /&gt;edit.startOperation()&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor(fc, fc_fields) as cursor:&lt;BR /&gt;for row in cursor:&lt;BR /&gt;join_value = row[0]&lt;BR /&gt;if str(join_value) in csv_data:&lt;BR /&gt;csv_row = csv_data[str(join_value)]&lt;BR /&gt;for i in range(1, len(fc_fields)):&lt;BR /&gt;fc_field_name = fc_fields[i]&lt;BR /&gt;csv_field_name = csv_fields[i]&lt;BR /&gt;row[i] = csv_row[csv_field_name]&lt;BR /&gt;cursor.updateRow(row)&lt;BR /&gt;else:&lt;BR /&gt;print("No matching values in CSV of join field: {join_value}")&lt;BR /&gt;edit.stopOperation()&lt;BR /&gt;edit.stopEditing()&lt;BR /&gt;print("updatedSucessfully")&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 19:20:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651609#M45745</guid>
      <dc:creator>GeorgeJonesRIGOV</dc:creator>
      <dc:date>2025-09-18T19:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can't update feature class from csv file in python script</title>
      <link>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651618#M45746</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/695311"&gt;@GeorgeJonesRIGOV&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it be possible to print both the join_value and the csv_data? It could be that the join_value is not in the csv_data, the address could be null or none as well.&lt;/P&gt;&lt;P&gt;I would start placing some prints around that would allow for some debugging!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 19:45:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651618#M45746</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-09-18T19:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can't update feature class from csv file in python script</title>
      <link>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651639#M45747</link>
      <description>&lt;P&gt;to format the code with line numbers for reference, see...&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 20:32:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651639#M45747</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-09-18T20:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can't update feature class from csv file in python script</title>
      <link>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651890#M45748</link>
      <description>&lt;P&gt;It should just match. Have the exact values in both the CSV and feature class .&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 19:34:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651890#M45748</guid>
      <dc:creator>GeorgeJonesRIGOV</dc:creator>
      <dc:date>2025-09-19T19:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can't update feature class from csv file in python script</title>
      <link>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651932#M45749</link>
      <description>&lt;P&gt;The error is just printed from your Else statement so I wouldn't take it as wrote.&amp;nbsp; If you can format your code with indentation that would help troubleshoot.&amp;nbsp; Dan has linked the formatting guide above.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 21:35:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/can-t-update-feature-class-from-csv-file-in-python/m-p/1651932#M45749</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-09-19T21:35:56Z</dc:date>
    </item>
  </channel>
</rss>

