AnsweredAssumed Answered

Extracting certain string/characters and numbers from field

Question asked by 2CQuiker on Sep 27, 2019
Latest reply on Oct 4, 2019 by 2CQuiker

I have a field with with descriptions and i need to extract the tax numbers from this field and put them into another field in the same layer. 

 

Some examples of what i need .

1. 

12-5N-5W SW NW SW S & W OF CANAL,, TX 2 IN SWNW LS TX 2-A

- I need to extract "TX 2" from this field

2. 

23-3N-2W SW 4TH ST TOWNHOMES TX 11271 IN LT 4C BLK 1

- I need to extract "TX 11271" from this row

3. 

04-5N-5W SE TAX 3 & TAX 4 IN NWSE

- I need to extract "TAX 3, TAX 4" from this row

4. 

21-4N-3W SW TX 86, 89, 90 & 93 IN S 1/2 OF SW

- I need to exact "TX 86, 89,90 & 93" from this row

 

 

 

I currently can extract numbers with the following and i need help to include what i mentioned above.  I guess i need to extract everything beginning at TX and before the space before the next alpha characters. 

fc = r'C:\Temp\Parcels.shp'

with arcpy.da.UpdateCursor(fc,['Legal','Legal2']) as cursor:
    for row in cursor:
        row[1] = ''.join([str(i) for i in row[0] if i.isdigit()])
        cursor.updateRow(row)

Attachments

Outcomes