I have data that (in part) looks like this
The values on the left are templates for StockCodes, the values on the right are StockCodes. I have maybe 80 Templates and thousands of StockCodes. The templates have been updated and I now need to apply those updates to the StockCodes based off of them. However, in the above list 3B7020-16EVE and 3B7020-1APX should not both match up with T-3B7020-1. Instead, 3B7020-1APX should match up with T-3B7020-1 and 3B7020-16EVE should match up with T-3B7020-16. If there was some way I could designate that every character after len(Template)-2 in the StockCode has to be a character I believe I could make this work (*so, left(StockCode,len(template)-2)+(AnyAlpha)), but I can not come up with how to make that work. Any suggestions?
Thanks,
Willie
Code:
T-3B7020-1 3B7020-16EFC
T-3B7020-1 3B7020-16EFC
T-3B7020-1 3B7020-16EFY
T-3B7020-1 3B7020-16EFY
T-3B7020-1 3B7020-16EVE
T-3B7020-1 3B7020-16EVE
T-3B7020-1 3B7020-1APX
T-3B7020-1 3B7020-1APX
T-3B7020-1 3B7020-1ASN
T-3B7020-1 3B7020-1ASN
T-3B7020-1 3B7020-1CTG
T-3B7020-1 3B7020-1CTG
T-3B7020-1 3B7020-1CZP
T-3B7020-1 3B7020-1CZP
The values on the left are templates for StockCodes, the values on the right are StockCodes. I have maybe 80 Templates and thousands of StockCodes. The templates have been updated and I now need to apply those updates to the StockCodes based off of them. However, in the above list 3B7020-16EVE and 3B7020-1APX should not both match up with T-3B7020-1. Instead, 3B7020-1APX should match up with T-3B7020-1 and 3B7020-16EVE should match up with T-3B7020-16. If there was some way I could designate that every character after len(Template)-2 in the StockCode has to be a character I believe I could make this work (*so, left(StockCode,len(template)-2)+(AnyAlpha)), but I can not come up with how to make that work. Any suggestions?
Thanks,
Willie