Select to view content in your preferred language

Add a leading character to a string

2162
2
Jump to solution
11-23-2014 09:39 PM
ChristopherEdwards
Deactivated User

Long story short, I'm trying to get County FIPS data to match from one table to the next.

One table has a string field with 3 character county FIPS codes, the other table has a longer codes where a number corresponding to each state precedes the 3 digit county code. For instance, Autauga County, Alabama is 1001 in one database but 001 in the other.

How would I go about adding a leading character to the string 001? (I figure part of the solution is to select each state and then run the field calculator on each selection, but flummoxed on how to form the expression.)

0 Kudos
1 Solution

Accepted Solutions
OwenEarley
Frequent Contributor

In ArcMap:

  • Create a STATEFIPS field (Text with a length of 2) in your layer.
  • Select your States and assign the State component of the FIPS code.
  • Create new field (Text with a length of 5) for example FINALFIPS.
  • Use the Field Calculator to concatenate the values:  [STATEFIPS] + [FIPSVALUES]

Assuming that FIPSVALUES is the name of your 3 character county FIPS code field.

View solution in original post

2 Replies
OwenEarley
Frequent Contributor

In ArcMap:

  • Create a STATEFIPS field (Text with a length of 2) in your layer.
  • Select your States and assign the State component of the FIPS code.
  • Create new field (Text with a length of 5) for example FINALFIPS.
  • Use the Field Calculator to concatenate the values:  [STATEFIPS] + [FIPSVALUES]

Assuming that FIPSVALUES is the name of your 3 character county FIPS code field.

ChristopherEdwards
Deactivated User

Not only was this helpful but now reading your reply I see that basically that was already done but didn't understand what I was reading. So thank you!

0 Kudos