AnsweredAssumed Answered

EOL errors when performed simple task

Question asked by iggz on Sep 12, 2013
Latest reply on Sep 12, 2013 by Caleb1987
I have a field that lists numbers in the following format:

"000000-000"


But when this data was inputted, the user just copied and pasted the value from an excel sheet into the program and this caused a carriage return to be inputted with the value above.

"000000-000 "


I haven't been able to fix this problem with Python, but I can with VB which seems a bit backwards to me.

Why is Python so limited within ArcMap?

To fix this I tried multiple ways in Python, but they all failed even though they were valid.

The only way I was able to fix it was by using VB to get the length of the field for each record. So the field length should be 10 (123456-890). But with the carriage return the length for these fields returned 11, so I am able to isolate them.

So I figured, hey I'll use Python now. So I wrote the following code:

def alterField(field):     a = field[0:10]     return a


And this simple function fails in ArcMap with an EOL error.

What gives?

I ended up having to use the VB Left() function to fix it.

Python is so powerful, but so limited by ArcMap.

Why is this and will this ever be fixed?

Outcomes