1

My model output got way too many rows to be exported to excel in arcgis ModelBuilder. It would work if I could use the new xlsx file format but it seems the toolbox can only do xls. After a little research I found that cvs might solve my problem, however when I attempted to use it I got the following error message;

Start Time: Tue May 24 08:37:19 2016
Running script ExportXYv...
Writing Results to ASCII File....
Failed script ExportXYv...

Traceback (most recent call last):
  File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\ExportXYV.py", line 159, in <module>
    export = setupXYV()
  File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\ExportXYV.py", line 50, in setupXYV
    outFieldNames = outFieldNames)
  File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\ExportXYV.py", line 139, in exportXYV
    UTILS.writeText(fo, "{0}\n".format(outRow))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc5' in position 624: ordinal not in range(128)

Failed to execute (Export Feature Attribute to ASCII).
Failed at Tue May 24 08:37:20 2016 (Elapsed Time: 0,79 seconds)

Does anyone know how I can solve this problem?

When I attempt to use the "table to excel" tool I get the following error:

"Executing (Table To Excel): TableToExcel C:\Users\fmromss\Documents\ArcGIS\Default.gdb\ro_arealressurs_f_fkb_ny_326_union C:\Users\fmromss\Documents\ArcGIS\scratch\ro_arealressurs_f_fkb_ny_326_union_TableToExcel.xls NAME CODE
Start Time: Tue May 24 08:59:14 2016
Running script TableToExcel...
ERROR 001531: Input table exceeds the 65535 rows limit of the .xls file format.
Completed script TableToExcel...
Failed to execute (Table To Excel).
Failed at Tue May 24 08:59:14 2016 (Elapsed Time: 0,82 seconds)"

As it takes a lot of time to scroll in the table Im not completely sure about how many rows we are talking about here but I know its over 180 000

  • What precisely prevented you from using Table To Excel? I.e. What parameter values did you use and what precise error message resulted? When you say "cvs" do you mean "csv"? How many rows is "way too many"? – PolyGeo May 24 '16 at 6:53
  • One click on correct icon at the bottom of the table, will get you to the last row – FelixIP May 24 '16 at 7:13
  • 1
    xc5 means you have an Å somewhere. Remove it together with any Ä and Ö, and you probably will have more luck. If you replace it with something distinguishable you can easily substitute back once you have your excel or csv. – Martin May 24 '16 at 7:15
  • Might try export to another dbf table, excel will read it – FelixIP May 24 '16 at 7:23
  • 1
    If you want people to hear you put @ in front of their nicknames. Do you really want over 1 MN records to be analyzed in Excel? May be some summary? – FelixIP May 24 '16 at 9:22
2

You can download Python package XlsxWriter, write a script and import to your toolbox for use in your model:

https://pypi.python.org/pypi/XlsxWriter

2

An alternative to CSV or dBase is to write to a personal geodatabase table, which is essentially an Access table. You if need your data in Excel (xlsx) then you could import it with the tools in Excel.

I would recommend writing to a personal geodatabase as it will accept unicode characters, so all your problems discussed above simply go away. You also write to a format which enforces good data structure, something a CSV does not do in my opinion.

  • hm, sounds good. I tried to use the Table to Table function (if thats the one you meant?) and got an error; ERROR 001156: Failed on input OID 1, could not write value 'Skogoglandskap ' to output field opphav The field is not nullable. [noyaktighe] Failed to execute (Table to Table). Failed at Wed Jun 01 15:02:29 2016 (Elapsed Time: 0,43 seconds) – MSS Jun 1 '16 at 13:02
  • I also tried the "Table to Geodatabase (multiple)" but the data that I got does not make any sense – MSS Jun 1 '16 at 13:04
  • Update your question to describe the source of your data and field names, the problem is likely to be there. – Hornbydd Jun 1 '16 at 13:31

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.