Copy data from one field to another

3143
2
Jump to solution
06-04-2013 05:01 AM
RanaMahmoud
New Contributor II
I'm trying to copy data from one field to another. I wrote a script, but it dioesn't work, I get the following error message:
"The calculated value is invalid for the row with the ObjectID = 1. For example, the calculated value may be too large for teh field or you may be trying to add a string to a number field. This row will not be updated"

The source and destination fields in my script are identical, both are string fields with 255 characters length. I don't know where the problem is!!!

Here's my code:
import arcpy import os  arcpy.env.workspace = r"Test_geodatabase_path"   arcpy.CalculateField_management("Test_FC_name", "Test", "Tes2")


Please help...
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RanaMahmoud
New Contributor II
Thanks a lot, it works perfecttly...

View solution in original post

0 Kudos
2 Replies
BartłomiejStaroń
New Contributor III
try,

arcpy.CalculateField_management("Test_FC_name", "test", '!test2!', "PYTHON")

or better use CalculateField in modelBuilder then export to python.
0 Kudos
RanaMahmoud
New Contributor II
Thanks a lot, it works perfecttly...
0 Kudos