|Perl Monk, Perl Meditation|
Parsing Guassian '03 Log Filesby Andrew_Levenson (Hermit)
|on Jan 31, 2008 at 01:12 UTC||Need Help??|
Andrew_Levenson has asked for the
wisdom of the Perl Monks concerning the following question:
Greetings, monks! It's been a while.I haven't been to the site, or even really thought about perl in a while, as I've been off having adventures in university-land.
Now, i'm doing some undergraduate research for theoretical chemistry, and find myself working with absolutely monstrous log files from the absolutely ingenious Gaussian '03. Today, my research mentor asked me to manually trudge through the log files to compile a list of bond lengths between certain atoms in the molecule I'm working on, but I realized that using perl could save me days worth of eye-straining work. Hooray! Unfortunately, I've grown a bit rusty.
What I need to do is create a script that reads in a log file, searches for an area of text between "Optimized Parameters" and "GradGradGradGrad", and then read each line and rip out the value and see if it fits in the range I'm working with. I know a regular expression will work wonders, but I am, as I said, really very rusty. If the individual lines I need to read look something like this example:
and a hypothetical 4 entry log looks something like this:
How can I grab the numbers under 'value,' keeping in mind that there may be lines looking like this in other sections of the incredibly dense log files?
Thanks a million in advanced.