Sunday 23 August 2015

Filling blanks (missing values) in table with value above using ArcGIS Field Calculator?


I'm using ArcMap to tidy up some field collected point data. The point data is a sequential track from a handheld device. In the attribute table i have a field with differant activities that separate out each track. However, only the first occurrence/point of the activity is filled in and the rest below are blank till the next activity. .eg.


running


-


walking


-


Is there a way to filldown the entries to blank fields below? There are hundreds of blank entries for each one with a value, not sure if this makes a difference.



Answer




Assuming this structure:


enter image description here


create new field and run this field calculator expression on it:


def fillMe(text):
global before
if text=="-":
return before
else:
before=text
return before



fillMe( !CAT_DOG!)

enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...