I have this column in MS Excel 2010 - which has a combination of 'zip code' and 'email-ids'
I am trying to extract these zip-codes(20530, 90012-3308 etc.) from this column.
20530 mark@ucvxcx.gov
20530 kidafd@gmail.com
20530 vladfeodsaf@usdodfaadj.govv
20530 syadfadsbil.vvbvx@vnvnvn.gov
20004 safdbnvis9dfg@infdda.gov
20530 vhlhsdlf8dlfha@vbvbcxbUI.GOV
90012-3308 h.james@asdfad.gov
90012-3308 madsfl.hjlkdjd@pkdoi.gov
90012 mark.fraser@ruskgb.zx
I tried Python's re module.
import re
for i in range(1, 9):
Cell(i, 4).value = re.findall(r'\d+', Cell(i, 1).value) #storing result in column4
I ran the regex on that column and I got this result:
[u'20530']
[u'20530']
[u'20530']
[u'20530']
[u'20004', u'9']
[u'20530', u'8']
[u'90012', u'3308']
[u'90012', u'3308']
[u'90012']
How can I extract the results, into the human readable zip-code form?