From: Tristan Croll (
Date: Mon May 12 2014 - 23:56:08 CDT

An even easier way to do this is to change your for loop to:

foreach traj [lsort [glob *.gro]] {
  mol addfile $traj waitfor all

Should work for any logically numbered trajectory set. Just keep in mind that lsort will sort alphabetically rather than numerically (so 100 will come before 11, for example).

From: [] On Behalf Of Josh Vermaas
Sent: Tuesday, 13 May 2014 12:41 AM
To: John Brown;
Subject: Re: vmd-l: Trajectory from multiple .gro files

Hi John,

Supposing they were numbered appropriately, it shouldn't be too hard. Use tcl to save yourself the agony of typing all the commands individually.

set mid [mol new]
for { set i 1 } { $i < 100 } { incr i } {
    mol addfile [format "filename-%03d.gro" $i] waitfor all

This assumes all the files are named something like "filename-001.gro", filename-002.gro, etc, all the way up to 100. Change the values as appropriate. Is there a reason you are using gro files? .gro files imply gromacs, and VMD can also read in the trajectory files gromacs writes.

-Josh Vermaas
On 5/10/14, 7:49 AM, John Brown wrote:

I have a molecular dynamics simulation which gives me .gro files with the atom co-ordinates every x time steps.

Is it possible to view these multiple files as a sequence using VMD to see the trajectories?

Any help would be greatly appreciated, thanks.