Hi to all of you
At work my boss has challenged me to extract a code from a string in a cell.
The code is like 4 characters (can be letters and numbers)-5 numbers-5 numbers-year (2 numbers)
Example: AB42-12345-54615-25. Letters can be upper and/ or lower case.
In most cases the code has text and or numbers before and after - and always parted with a space on either side.
Example - "this is a test AB42-12345-54615-25 sold august 30. 2025"
Can any of you help me - in Power Query or otherwise to extract the code to a new column ?
In this example it would be - "AB42-12345-54615-25"
At work the file has 100.000 plus rows, so it will save me a lot of time.
Thank you
Erik
Must you do this in PQ?
Quite easy to do it in Excel. Have a look at the attached. Not very difficult to replicate this in PQ as well. Find the location of the first "-", minus 4 and then extract the next 19 characters.