I have a list of strings representing different types of data
{{"gw12-26b-pl1", "63.6512", "0.0076", "--", "Al2O3", "%", "23.4002"},
{"gw12-26b-pl3", "65.1182", "0.1257", "--", "SiO2", "ppm", "76.3388"}};
I want to convert the 'numerical strings' to expressions so that I can work with them. I want to end up with something like:
{{"gw12-26b-pl1", 63.6512, 0.0076, "--", "Al2O3", "%", 23.4002},
{"gw12-26b-pl3", 65.1182, 0.1257, "--", "SiO2", "ppm", 76.3388}}
I tried to convert the whole list using ToExpression and then convert non-numeric elements back to strings but this doesn't work because it is trying to evaluate elements like gw12-26b-pl1as an expression.
Can anyone suggest an easy way to do this?
t@{"67", "34d-45b", {"b", "27", {"ww", "11.1", {{"67.1"}, "aa", "3"}}}} – geordie May 20 '14 at 01:50Internal`StringToDoubleinstead ofToExpression– Murta May 20 '14 at 01:52ReplaceAll. – halirutan May 20 '14 at 02:07Internal\StringToDouble` – Mike Honeychurch May 20 '14 at 02:44Conditionversion in addition toPatternTest– Mike Honeychurch May 20 '14 at 02:46