nevmiles

Populate Table Column Based on Known List

Discussion created by nevmiles on May 20, 2011
Latest reply on May 24, 2011 by nevmiles
Hi,

I am trying to figure out how to populate a column in my table based on a list of certain values from another field.

Here is my situation:


  • I have a shapefile with the countries of the world.  There is only a "NAME" and "SHAPE" column.

  • I have a list of which countries in the world that use a 50hz electricity frequency and ones that use 60hz.

  • I have added a "frequency" field to the table, and now want to populate that field with the appropriate frequency for each particular country.

Rather than manually enter each frequency, I was thinking that perhaps I could make a list/array of the countries with, for example, the 50hz frequency, then having my script loop through the list, and for each item in the list/array that matches my table, populate the frequency field with "50"?  But I can't figure out how to do it. 

For example, here is a short list of ten countries that use the 50hz frequency:
Afghanistan
Albania
Algeria
Andorra
Angola
Argentina
Armenia
Australia
Austria
Azerbaijan


How can my script use this info to go through my table and populate the "frequency" field with "50" for each of these countries?

Thanks.

Outcomes