I have found that in 10.0 Field Calculator is quite weird.
But I've managed to get it work. The main idea is to enclose field name with single quotes.
Example. let suppose we have fields text1
and text2
. Rather than Calculating field text2
with expression !text1!
, which probably will fail, try this one: '!text1'
. As you see I am using single quotes here.
So, back to your task. It will be more clear to use Pre-Logic Script Code:
def calc(value):
return value.replace('"', '')
Expression will be:
calc('!text1!')
I hope it will work for you.
I have not experimented further but I think that such weird behavior happens because field calculation is translated into the call to ArcToolbox tool CalculateField_management
and expression is provided as a parameter to it (probably additionally enclosed with single or double quotes).
UPDATE:
My previous solution will fail in case if there are single quotes in the values of field text1
.
Now I have managed to get it work both in case when there are chars '
and "
(single and double quotes) inside any value in attribute text1
.
Here is expression, which will return original string, supporting both types of quotes:
'''!text1!'''[1:-1]
For your task it can be extended to (without Pre-Logic Script Code):
'''!text1!'''[1:-1].replace('"', '')
!testing![1:len(!testing!)-1]