Select to view content in your preferred language

Geocode File can't parse csv Header

177
4
Jump to solution
02-20-2025 09:52 AM
Labels (1)
ChrisCowin_dhs
Regular Contributor

Trying to use the Geocode File geoprocessing tool but it doesn't like my csv for seemingly no reason. In the drop down of fields for Single Line Input it just gives "Field1" through "Field8" not the actual name of the field but it's just a csv there is nothing special about it. So the stupid tool is giving me a list of things to select from that won't ever work. What do I need to do to make Pro read the header which is just the first row??

Error: 

...https://wpdhsgisl06.dhs.sdc.pvt/server/rest/services/Utilities/GeocodingTools/GPServer/uploads/i3aa153b6-c72c-495e-9dcc-e13e9f0a8c7c
...https://wpdhsgisl06.dhs.sdc.pvt/server/rest/services/Utilities/GeocodingTools/GPServer/GeocodeFile/jobs/jd9f851c1dba84eeea5792e4a53a1f722
Batch Geocode Message: Submitted.
Batch Geocode Message: Executing...
Batch Geocode Message: {"messageCode": "AO_100201", "message": "Your field_mapping includes an input field Field5 not present in your input file: ['WIC_ID', 'WIC_GENERAL_CATEGORY_CODE', 'FULL_STREET', 'ADDRESS_HOME_CITY_STATE_ZIP', 'FULL_ADDRESS', 'ADDRESS_TYPE_CODE', 'ZIP_CODE', '7'].", "params": {"field": "Field5", "supported_fields": ["WIC_ID", "WIC_GENERAL_CATEGORY_CODE", "FULL_STREET", "ADDRESS_HOME_CITY_STATE_ZIP", "FULL_ADDRESS", "ADDRESS_TYPE_CODE", "ZIP_CODE", "7"]}}
Batch Geocode Message: Your header row could not be parsed 
Batch Geocode Message: Failed to execute (GeocodeFile).
Batch Geocode Message: Failed.

 

CSV:

WIC_ID,WIC_GENERAL_CATEGORY_CODE,FULL_STREET,ADDRESS_HOME_CITY_STATE_ZIP,FULL_ADDRESS,ADDRESS_TYPE_CODE,ZIP_CODE,7
00071356-05,C,<STREET ADDRESS> ,<CITY STATE ZIP>,<STREET ADDRESS CITY STATE ZIP>,HOME,97470,12
0 Kudos
1 Solution

Accepted Solutions
BarryNorthey
Frequent Contributor

It looks like the header row has a field name that starts with the number 7 which isn't allowed. Excel will also reject 7 as a field name. Edit the field name to start with a letter or underscore such as A7. 

View solution in original post

4 Replies
BarryNorthey
Frequent Contributor

It looks like the header row has a field name that starts with the number 7 which isn't allowed. Excel will also reject 7 as a field name. Edit the field name to start with a letter or underscore such as A7. 

ChrisCowin_dhs
Regular Contributor

So, when I remove that column completely it still doesn't get the headers it gets the second row with the actual data

0 Kudos
BarryNorthey
Frequent Contributor

What happens if the header row is:

WIC_ID,WIC_GENERAL_CATEGORY_CODE,FULL_STREET,ADDRESS_HOME_CITY_STATE_ZIP,FULL_ADDRESS,ADDRESS_TYPE_CODE,ZIP_CODE,A7

0 Kudos
ChrisCowin_dhs
Regular Contributor

That works but then I'm getting an error on the Locator saying that it can't be attached, but the locator works fine for the Geocode Address tool. It is just the Street Map Premium USA locator.

Start Time: Thursday, February 20, 2025 10:26:07 AM
...https://wpdhsgisl06.dhs.sdc.pvt/server/rest/services/Utilities/GeocodingTools/GPServer/uploads/i2b9aef94-8657-4504-91a3-51aa3b4d2ac4
...https://wpdhsgisl06.dhs.sdc.pvt/server/rest/services/Utilities/GeocodingTools/GPServer/GeocodeFile/jobs/jbd649eb49d8547d2909f7bfa5b3fa7bf
Batch Geocode Message: Submitted.
Batch Geocode Message: Executing...
Batch Geocode Message: Traceback (most recent call last):
  File "D:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcToolBox\Services\scripts\GeocodeFile.py", line 466, in <module>
    arcpy.AttachLocator(locator_path, fc, inputFieldNames, outputFieldNames, geocoding_options)
  File "D:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\__init__.py", line 1833, in AttachLocator
    return arcgisscripting._attachLocator(loc_path, fc_path, input_field_names, output_field_names, settings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: https://wddhsgisl02.dhs.sdc.pvt/server/rest/services/USA/GeocodeServer

Batch Geocode Message: Failed to execute (GeocodeFile).
Batch Geocode Message: Failed.
ERROR 002617: Batch Geocoding stopped with status esriJobFailed.
Failed to execute (GeocodeFile).
Failed at Thursday, February 20, 2025 10:44:01 AM (Elapsed Time: 17 minutes 53 seconds)
0 Kudos