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<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
- I need to extract "TX 2" from this field
2.
23-3N-2W SW 4TH ST TOWNHOMES TX 11271 IN LT 4C BLK 1<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
- I need to extract "TX 11271" from this row
3.
04-5N-5W SE TAX 3 & TAX 4 IN NWSE<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
- 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<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
- 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)<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>