From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Feb 15 2007 - 22:44:32 CST

Hi,
  I'm not sure why you're getting the error, as I've run the script
you included in your email and I didn't get any errors. Perhaps there's
an unseen typo in your script (an escape or control character?) that
isn't showing up in what you sent in your emails? It's also possible
that your script works for some files but not others, and that my test
happened to work and yours encounters a bug. I'd suggest having a look
at the way Peter's "namdenergy" plugin reads the NAMD log files, as
he's using regular expressions for pattern matching, which is presumably
more robust with minor variations in output format.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Feb 13, 2007 at 02:18:58PM -0500, greddy1_at_umd.edu wrote:
> Hello,
> I am new to tcl scripting and I am trying to extract the total energy from the
> NAMD log file.
>
> The tcl script I am trying to use it as follows:
> -------------------------------
> set file [open temp.log r]
> set output [open ene.dat w]
> while { [gets $file line] != -1 } {
> if {[lindex $line 0] == "ENERGY:"} {
> puts $output "[lindex $line 1] [lindex $line 11]"
> }
> }
> close $file
> close $output
> --------------------------------------
>
> When I try to run the script in the TkConsole of VMD I get the following error.
> "list element in quotes followed by "," instead of space"
>
> Can somebody please point out the bug in the code.
> Thank You
> Greddy

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078