#! /bin/csh -f
#I output, rather stupidly, all the SED based continuum values for all 
#counterparts. I need to make a list of counterparts listed for 
#each emission line to get the indexing.
set n_mv1 = 0
set n_em = `wc -l < classify_j1.out`
set n_cnt = 0
set n_accm = 0
rm -f shuf_index.out
while ($n_cnt < $n_em)
   @ n_cnt = $n_cnt + 1
   echo "$n_accm" >> shuf_index.out
   if ($n_cnt < 10) then
      set form_tag = "000"$n_cnt
   else if ($n_cnt < 100) then
      set form_tag = "00"$n_cnt
   else if ($n_cnt < 1000) then
      set form_tag = "0"$n_cnt
   else
      set form_tag = $n_cnt
   endif
   set new_n = `wc -l < SEDs/nspawn_${form_tag}.cat`
   set n_accm = `echo "$n_accm + $new_n" | bc -l`
end
exit(0)
