extract text from string, leaving numbers and operators
I have a column containing text and numbers with operators, such as:
"4 weeks * 40 hours per week." or
"4 wks * 40 hrs per week = 160 hours." or
"2 wks * 40 hrs per week + 2 wks * 20 hrs per week."
I need to strip out the text and end up with a formula, such as "4*40",
resulting in 160.
Need to recognize +, -, *, /. And need to ignore anthing after =, if there
is one.
The objective is to take what is sometimes a long text string and check the
math in the string.
I'm guessing this will take some fancy code. Any help greatly appreciated.
--
CG
|