# spin component 1
startline=`grep -n spin\ component\ 1 $file | tail -1 | awk -F: '{ print $1 }'`
echo -en "spin component 1 ($startline)... "
sed -n "$startline,/spin component 2/p" $file | grep ^' '*[0-9] | \
while read number energy occu; do
# spin component 1
startline=`grep -n spin\ component\ 1 $file | tail -1 | awk -F: '{ print $1 }'`
echo -en "spin component 1 ($startline)... "
sed -n "$startline,/spin component 2/p" $file | grep ^' '*[0-9] | \
while read number energy occu; do