Message 1 of 11

Not applicable
09-27-2017
06:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to write a rule that will extract either one or two numbers from a string.
For example, the results from these string would be as follows:
Bar round 35.0mm x 3m mild steel
- 35.0
Section box 30 x 30 x 3mm mild steel
- 30
- 30
Bar flat 80 x 8mm x 6.1m mild steel
- 80
- 8
Rod 5 mm x 3mt stainless steel grade 304
- 5
Its essentially the first two numbers that are separated by an "x", but I'm thrown a curve ball when I only need one number returned.
The other issue I need to overcome is that the format is not always consistent, for example some entries:
- may not always have a space either side of the "x"
- might include a space between the number and "mm"
- metre will be written as "m" and other times it will be "mt" or "mtrs"
Any tips on how to achieve?
Solved! Go to Solution.