2

I have a text file that I am trying to bring into ArcMap to convert to a shapefile. I am familiar with the process of bringing in the text file and then using the "Display XY Data" tool and exporting to a shapefile.

The problem I am running into is that only part of my data will display. The first 11 records appear but the ones past that point do not. When I try to view the attribute table, I get an error message that says "There was an error loading records. The row contains a bad value [OIDTable11]. The row contains a bad value. [Field 5]".

I can't see any difference between the rows that appear and the row that apparently contains a bad value. I was hoping that someone could help me find the "bad value" so that my table will import in its entirety.

Here is a screenshot showing my original text file and the rows that display in ArcMap: enter image description here

5

It has to do with the " representing inches, but interpreted as a quotation surrounding a string. The clue is in the records it imported. It did not import the records with ID numbers 252, 299, 301 and 306. Why, because these records are enclosed between quotation marks on the end of the line above them and at or toward the end of them. Line 249 is the first line with a quotation mark at the end, which is why it first affects record 252. Those records that did not come in all actually are within Field 5, but hidden due to the return character of the row above them being included in the string, so that Field 5 contain 2 lines (one visible the other hidden).

The line containing ID 1087 fails, because it is the next line that ends with a quote that would begin a string value, but the lines below it have no end quote to make the string stop. So it fails, because the string it builds is more than the 255 characters allowed in Field 5.

Anyway, you need to replace all quotation marks with another character like "~". Then use a field calculation to replace all "~" characters with """" (the VB way to create a quote character literal in a string).

  • Thanks, very helpful. I replaced all of my " (inch marks) with "''" (double quote, single quote, single quote, double quote). Is that what you meant by "the VB way to create a quote character literal in a string"? It seems to have worked, but I wanted to make sure I understood what you meant. – Sara Barnes Nov 25 '14 at 20:42
  • 1
    That works. I was actually trying to avoid all quote characters in the text document by using the ~ character. After import I would do a field calculation replacing all ~ characters with ". But you can do the same and replace all single quote pairs with a double quote. The VB expression would be: Replace([Field5], "''", """") – Richard Fairhurst Nov 25 '14 at 20:47
1

I think it has to do with the '-' hyphen in Field5 .

For ArcGIS to work with multiple data types, certain characters in field or table names are not supported. These characters include spaces, hyphens, such as in the term 'x-coord', brackets, and other special characters. These limits are imposed so that ArcGIS is able to function with the maximum amount of data types.

Sources: http://support.esri.com/cn/knowledgebase/techarticles/detail/23087

  • Thanks for the quick reply. I'll remove the - and report back. – Sara Barnes Nov 25 '14 at 20:10
  • I removed all of the "-"s and that did not seem to make a difference. So I tried removing all of the characters other than letters & numbers (- / .) and it worked. I'm not sure which change exactly fixed it, but it is working now. Thanks for the answer! – Sara Barnes Nov 25 '14 at 20:17
  • I'm glad to help! – Maksim Nov 25 '14 at 20:19
  • 1
    See my post below. It is the quote character that is the primary suspect. Other characters may also be a problem, but you should try it with just replacing the " characters. – Richard Fairhurst Nov 25 '14 at 20: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.