--- /dev/null
+#!/bin/sh
+
+#
+# convert moldyn output to parcas/rasmol output
+# frank.zirkelbach@physik.uni-augsburg.de
+#
+
+if [ ! -d $1 ]; then
+ echo "no valid directory"
+ exit 1
+fi
+
+TRG=$1/md.movie
+
+rm -f $TRG
+
+((frame=1))
+
+for file in $1/atomic_conf_*.xyz; do
+
+ count=`grep '# \[P\]' $file | awk '{ print $3 }'`
+ time=`grep '# \[P\]' $file | awk '{ print $4 }'`
+ x0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $3 '}`
+ y0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $4 '}`
+ z0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $5 '}`
+ x1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $3 '}`
+ y1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $4 '}`
+ z1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $5 '}`
+ dimx=`echo $x0 $x1 | awk '{ print $2-$1 }'`
+ dimy=`echo $y0 $y1 | awk '{ print $2-$1 }'`
+ dimz=`echo $z0 $z1 | awk '{ print $2-$1 }'`
+
+ echo " $count" >> $TRG
+ echo " Frame number $frame $time fs boxsize $dimx $dimy $dimz" >> $TRG
+
+ ((ac=1))
+
+ cat $file | grep -v '^#' | while read name x y z color temp; do
+ # well, i only use Si and C
+ [ "$name" = "Si" ] && type=1
+ [ "$name" = "C" ] && type=2
+ echo "$name $x $y $z $type ${ac}" >> $TRG
+ ((ac+=1))
+ done
+
+ ((frame+=1))
+done
+
+