Reading in strings - 256 char limit

504
3
Jump to solution
08-06-2012 11:16 AM
JonPedder
Occasional Contributor II
Hi, I'm reading in text values from xls and csv files, I'm using row.getValue('Field_Name") to read the values in. This method is working well with short sentences but fails once it hits 256 chars.

Is there another method that allows more characters to be pulled in?

Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Esteemed Contributor
I'm reading in text values from xls and csv files, I'm using row.getValue('Field_Name") to read the values in. This method is working well with short sentences but fails once it hits 256 chars.

Is there another method that allows more characters to be pulled in?


This is a limitation of how tables are read in ArcGIS (using Microsoft Jet). However, there are limitations writing large strings to some data types as well (.dbf, .mdb).

You may have more luck reading long strings in a .csv using the python csv module.

View solution in original post

0 Kudos
3 Replies
curtvprice
MVP Esteemed Contributor
I'm reading in text values from xls and csv files, I'm using row.getValue('Field_Name") to read the values in. This method is working well with short sentences but fails once it hits 256 chars.

Is there another method that allows more characters to be pulled in?


This is a limitation of how tables are read in ArcGIS (using Microsoft Jet). However, there are limitations writing large strings to some data types as well (.dbf, .mdb).

You may have more luck reading long strings in a .csv using the python csv module.
0 Kudos
JonPedder
Occasional Contributor II
Thanks that was helpful.

The odd behavior in reading strings equal to or longer that 256 is that the entire script fails, not just the one long string. For a field named Description and pulling in 10 rows of data, if just one value is too large all 10 rows fail on that field. You'd think that just the one record would fail not all.
0 Kudos
curtvprice
MVP Esteemed Contributor
Thanks that was helpful.

The odd behavior in reading strings equal to or longer that 256 is that the entire script fails, not just the one long string. For a field named Description and pulling in 10 rows of data, if just one value is too large all 10 rows fail on that field. You'd think that just the one record would fail not all.


Microsoft Jet parses through the first few rows of the file to determine datatype. This setup process is clearly broken by your long strings!

Here's more about this in the 10.0 help:

Adding an ASCII or text file table
0 Kudos