0
$\begingroup$

i want to extract out the data (number) from 'geometry step' and 'total energy' in form of list to PlotList[] it. this is the Log file data log

Abstract the Total Energy for every Geometry step in the form of a list, list={{1,TE1},{2,TE2},...,{n,TEn}}

$\endgroup$
2
$\begingroup$
data = Import[
"http://comsics.usm.my/tlyoon/teaching/ZCE111_1516SEM2/data/dftb.\
log", "Table"];
list = Last /@ # & /@ 
Partition[
Cases[data, {"**", "Geometry", "step:", _?NumericQ} | {"Total", 
  "Energy:", _?NumericQ}], 2]
|improve this answer|||||
$\endgroup$
  • $\begingroup$ Beat me to it! You could remove the Last /@ # & /@ if you replace the pattern with {"**", "Geometry", "step:", a_?NumericQ} | {"Total", "Energy:", a_?NumericQ} :> a] $\endgroup$ – Jason B. May 6 '16 at 7:48
  • $\begingroup$ @JasonB great point! $\endgroup$ – happy fish May 6 '16 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.