#!/bin/sh 
if [ $# -ne 1 ];then echo Please input list.txt ;fi

cat $1|while read i;do
atomnum=`egrep '.+' $i|wc -l`
atomnum=$((atomnum-3))
sed -i '1,3d;4s/.*/'"$atomnum"'/' $i;
mv $i ${i%.txt}.xyz
done
