QGIS ArcGIS Python – How to Find and Replace Attribute Values Based on a List

arcgis-desktopfields-attributespythonqgisupdate

I have a Shapefile and a list in .csv which contains two columns with names:

  • "Old_name" which contains the old names that already exist in the attribute table of the previously mentioned Shapefile; and
  • "New_name" which contains the updated name.

How can I do this either on ArcGIS, QGIS or with python?

Based on this question I need to use the UpdateCursor function, but how can I use the list in this function?

Best Answer

In QGIS you can perform Add Vector Join.

  1. Right click on your shapefile layer on Layer Panel and choose Properties.
  2. Then go to Joins tab.
  3. Press the + button, it will create new join. enter image description here
  4. Join layer is your shapefile layer. Join field is field with the common values in both. Target field is your field you want to join to.
  5. After that you will get a new attribute in your shapefiles table.

In ArcGIS it is very similar. You need to use Add Join tool.

More about joining in ArcGIS.