[GIS] When the table is too big for it to get exported to excel in arcgis ModelBuilder

arcgis-10.3arcgis-desktopexcelmodelbuilder

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

Best Answer

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

Related Question