0

I have a list called list1:

[('C:\\Users\\user\\Desktop\\merge\\output_c\\exports\\r01\\r01.shp',
  'C:\\Users\\user\\Desktop\\merge\\promerge\\r01\\r01.shp'),
 ('C:\\Users\\user\\Desktop\\merge\\output_c\\exports\\wwa\\wwa.shp',
  'C:\\Users\\user\\Desktop\\merge\\promerge\\wwa\\wwa.shp'),
 ('C:\\Users\\user\\Desktop\\merge\\output_c\\exports\\ds\\ds.shp',
  'C:\\Users\\user\\Desktop\\merge\\promerge\\ds\\ds.shp')]

then append what is in the output_c to the promerge

for i,j in list1:
    arcpy.Append_management([i], j, "NO_TEST") #appends first item to the second

gives:

ExecuteError: ERROR 001156: Failed on input OID 0, could not write value ' ' to output field DEC_W Failed to execute (Append).

The field DEC_W is empty and gives error while its is told to be appended. Is it possible to complete the append of its other fields and just ignore the fact that only this field is empty and continue?

This script works fine for all the files and only with this file that has DEC_W empty it doesn't append it. I would like to append all its fields and ignore this specific field that is empty of this file.

UPDATE:

Maybe somehow check if that specific shapefile has empty that field and if it is to delete it before the append? How can I do that?

  • What are the data types of your DEC_W field? Is the DEC_W field present in both your 'i' and 'j' datasets? Do the data types match? Does the field DEC_W allow null values? – LMB Nov 20 '18 at 11:37
  • Yes exist in both. The data types are not the same but this shouldn't be an issue because that's the reason I do the append to these empty files. To take the types of the empty ones and also have the values of the full ones. – user10671234 Nov 20 '18 at 11:40
  • The different data types should not be an issue, or are you sure? I haven't tested it, but it sounds like a source of trouble. – LMB Nov 20 '18 at 11:41
  • What happens when you try this using the Arc toolbox? Same error, or no? – AlexS1 Nov 20 '18 at 16:52
1

According to the Error 001156 documentation of ArcGIS you seem to be joining fields with two different data types. Ensure that the fields you are joining have the same data type.

  • Some types although not same can be appended. But others it appears that can't cooperate. I will check this now. – user10671234 Nov 20 '18 at 12:01
  • the issue is that it is empty after all.Now what – user10671234 Nov 20 '18 at 13:00
  • Do you mean that the problem is that the field is empty, or that the entire shapefile is empty? Can you epxplain how you know that that is the cause of your problem? How did you test it? – LMB Nov 20 '18 at 14:52

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.