I have replaced formulas by the respective values, ending up with a large column of this:
8/4
8+4
9*84
48/74
(8+5)/7
(4*150,5)/(8,05/4,08)
I need to handle these strings (WSTR) as a regular expression, ending up with one numeric value.
Originally this was done in VBA with the eval function.
---Edit since answer:
Have to admit i always avoided the Script Component because i've never gotten it to work.
I tried now and with your link got to this code:
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
Row.OutM01 = Evaluate(Row.M01);
}
static double Evaluate(string expression)
{
var loDataTable = new DataTable();
var loDataColumn = new DataColumn("Eval", typeof(double), expression);
loDataTable.Columns.Add(loDataColumn);
loDataTable.Rows.Add(0);
return (double)(loDataTable.Rows[0]["Eval"]);
}
Yet, Specified cast is not valid or syntax errors is the only thing i ever get.