1

I am trying to merge two text columns (consisting of 2 digit and 3 digit numbers respectively) into one in ArcGIS 10.2.1 desktop version, but unable to do so. I have added a new field and kept it as text. On using arc toolbox > data management tools > calculate field, I am trying to merge the two columns into the newly created column.

Example:

I have the following two columns in the shapefile - Code1 (text, 10) and Code 2 (text, 10). I want to concatenate the values in these two columns in a new data field Key (text,11) that I have already created.

Code1 Code2  Key                                                                         
015   21     21015                                                                                    
647   19     19647                                                                               
213   05     05213 

When I try to use field calculator I get the error no records within table. See below:

enter image description here

  • What output do you get? Could you post an image of your Field Calculator window? What are the field lengths of each of the three text fields? – smiller Jun 11 '18 at 19:48
  • hi, the length of each field is 10 and its Data Type is Text. Also the output is blank in the desired field. The error message says - No records within table. – ruchika Jun 12 '18 at 5:42
  • Use python parser and: !RMSCODE2!+!RMSCODE1! – BERA Jun 12 '18 at 6:59
1

General answer (may update based on poster's details of what they've tried):

Change the Parser in the Field Calculator to "Python".

For the field calculation, double click the fields you want to add, separating them by a plus sign. (Plus sign is also used when concatentating strings).

The example code would be:

!field1! + !field2!

Edit: Question was updated to include error message "No records within table". This is possibly due to extent in the environment settings per ArcGIS Calculate Fields gives Warning 000405 No records within table?

1

Check if extent from spatial data has been set and if data being concatenated is extrapolating it. See: ArcGIS Calculate Fields gives Warning 000405 No records within table?.


In field calculator, two options to concatenate fields exist: using VB parser or Python parser.

  • hi.. thank you for replying, but still getting the same error. the error message is - No records within table – ruchika Jun 12 '18 at 5:36
  • than export everything in excel sheet, do whatever you want, and joins two tables to get your field. – Florjan Jun 12 '18 at 7:17
-1

You can also do it with OGRINFO and OGR2OGR GDAL

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • GeospatialEngineer, please expand upon your answer. – smiller Jun 14 '18 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.