I am editing a vector layer in ArcMap 10.1 in the attribute table the no data value for some of my fields is -1.7976931348623157e+308. I would like to replace that with 0.
I attempted to use the Find and Replace function in the Table Options using the following settings:
Find what: -1.7976931348623157e+308
Text Match: Whole field
Search: Down
Match Case: Unticked
Search Only Selected Field(s): Ticked
Replace with: 0
Clicking either Find Next or Replace All results in an error message:
Search error
An invalid SQL statement was used.
An invalid SQL statement was used. [Ground_Dissolve2]
An invalid SQL statement was used. [SELECT * FROM Ground_Dissolve2 WHERE (htMN = -1.79769313486232e+308)
What does this error message mean and how do I replace -1.7976931348623157e+308 with 0?
2 Answers 2
Try the following:
- You can use a simple python function in Field Calculator to do this update. I'm not sure if you have any other values that may be less than zero, if so you can just change
if value < 0:
statement. See example below:
enter image description here
- An alternative would be to do a select by attribute on all records that are < 0, then simply field calculate 0 for those selected records.
-
I get a syntax error on line 4
def changeVal(value): if value < 0: return 0 else: return value
andchangeVal( !htMN! )
where htMN is the field to be changedfalcs– falcs2013年09月10日 09:14:28 +00:00Commented Sep 10, 2013 at 9:14 -
It was something to do with the number of spaces before the text on each linefalcs– falcs2013年09月10日 09:55:42 +00:00Commented Sep 10, 2013 at 9:55
Have you tried this ? Would this help ? There is a toolbox that might help you ? Check this out From/to String toolbox
If this is not what you looking for then there are others on that website.
-
It looks like artwork copied this from that Geospatial Analyst website. Sorry for duplicate.PROBERT– PROBERT2013年09月10日 14:20:13 +00:00Commented Sep 10, 2013 at 14:20
Explore related questions
See similar questions with these tags.