I have 101 files each with a lot of data. from C output. (.out files) I have imported them to Mathematica 9. However, Mathematica reads the data from each file as an element of a table. So I used StringSplit, to split the data and it looks like this
{{{"425060", "0.214235E+07", "0.48", "0.01", "0.39", "0.49", "0.01",
"0.38", "1.64", "-1.65", "-2.13", "518"}, {"6650479",
"0.934695E+06", "0.48", "0.39", "0.43", "0.49", "0.39", "0.44",
"2.20", "-0.72", "0.51", "226"}, {"1248079", "0.153025E+07",
"0.04", "0.07", "0.30", "0.04", "0.07", "0.31", "-0.44", "-0.52",
"3.36", "370"}, {"4482147", "0.595558E+06", "0.39", "0.26", "0.38",
"0.39", "0.28", "0.41", "0.95", "2.76", "5.47", "144"}, ......
My problem is with the E+07
etc terms, when I try to convert this entire data to expressions, using ToExpression
, Mathematica converts E -> e=2.73
and evaluates the value. I have tried using HoldForm
and Hold
etc, however I do need those values to weed out a large portion of data. I have looked into ImportString
, StringReplace
etc options that were posted here, however they were for individual strings and not a list.
s = {"425060", "0.214235E+07", "0.48", "0.01", "0.39", "0.49", "0.01", "0.38", "1.64", "-1.65", "-2.13", "518"}; Internal
StringToDouble[#] & /@ s`, see mathematica.stackexchange.com/questions/1737/… $\endgroup$