I am attempting to extract a date stamp that is contained in one field and insert it into another field. The issue is that the date (in bold below) is not in the same location in each line of the data. I am able to find the location of the first "-", using python !fieldName!.find(-). Any ideas on how to complete the next step? I have thought about using a Mid function, but haven't been able to figure it out so far.
Data: ABCDE.ABCD-111611-43141 and ABCDEFG.ABCD-062914-95642
Here is what we came up with in the end:
Pre-Logic Script Code:
def ExtractDate(inValue): import string x= inValue.find('-') return inValue[x+1:x+7]
ExtractDate( !MyFieldName! )