Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

Concatenating fields while also replacing values within certain stings [closed]

$
0
0

I am trying to use python to concatenate multiple fields in a polygon layer. Specifically, I am attempting to combine the values of four fields into one:

EXPCODE =

!MATRIX! & !PLANT! & !PCT! & !SITE!

This function seems straightforward to me, however, I would like to replace characters withing the MATRIX field. A few examples of a MATRIX value would be:

H3C
H4A
CS4B
HS4D

After concatenating the EXPCODE field, I need to then write a replace function where all MATRIX “A” and “B” values are combined (H4B becomes H4AB).

Can anyone help me write this as one fluent function? I know I posted this as a python question, but if you are more comfortable with helping me using VBScript I am fine with that.


Viewing all articles
Browse latest Browse all 767

Trending Articles