Quantcast
Channel: Latest Questions by Andy Hornby
Viewing all articles
Browse latest Browse all 10

Extracting part of a string, if a type exists

$
0
0
I'm trying to extract a short amount of data from a string, but only if the data exists within the string. We have a number of products and against one of them, there may be a 'Pip Height'. Here is some example data: CO_Number CO_Line Item_Description C12345 1 DGA4/150x150 C12346 1 DGB4/150x150/Pip0.0 C12347 2 DGB4/450x450/PIP25.0/NRP225x225/DO C12348 1 DGB4/450x450/PIP19.0/NRP225x225 C12349 2 DGA4/450x450/DO What I want to achieve is to return null values for those that don't have a PipHeight (example rows 1 & 5 above), but for those that do, return the size, which would be either one or two characters after the word 'PIP', then a decimal, then one character after that (??.? or ?.?). The sizes (apart from 0.0) range from about 15.0 up to 40.0 in 0.1 increments, which I could do as a long list, but hopefully there is an easier way ?

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images