vendredi 17 avril 2015

extract fraction and 2 or 4 digit year from mulitple formated strings

I have 130,000+ plus strings which contain measurements such as 3/4", 1", etc and house number such as 5648 or 222 and then years formatted ilk 02, 92 or 2004 depending upon what the user felt like typing in that day. I also have \ and - in there randomly just to make it more fun.


What I need is: the first measurement value ie 3/4" or 2" and the year 02 or 1997. I have tried multiple splits and replaces but I don't seem to be getting very far. I have most of the measurements pulled out using a split at ". Any help would be nice. Someone suggested regular expressions but I have never used these.


Here are some examples:



3/4"-6235\PE-03,
1"-8018\ \PE-00,
3/4"- \ \PE-2004,
1"-11769\ \74\COPSET,
PE-85,
1"-BLDG 1,
COMM CABLE

Aucun commentaire:

Enregistrer un commentaire