pro cron,dummy
;
;   processes the cron.date and cron.offset files that are created
;   with the following grep commands:
;
;		grep -h Date folder/cron
;		grep -h server folder/cron
;
;
;	@(#)cron.pro	1.1 09/22/96 LASCO IDL LIBRARY
;-
openr,lu,'cron.date',/get_lun
a=''
ndate=0
months = 'JanFebMarAprMayJunJulAugSepOctNovDec'
repeat begin
   readf,lu,a
   k=strpos(a,',')
   if k gt -1 then begin
      ndate = ndate+1
      ;  decode date and time here
      k = k+2 		; skip over comma and blank
      ku = strpos(a,' ',k)
      dd = fix(strmid (a,k,ku-k))
      mon = strmid (a,ku+1,3)
      yy = fix(strmid (a,ku+5,2))
      mm = ( strpos(months,mon) / 3 ) +1
      kday,dd,mm,yy,kd
      if ndate eq 1 then dates = [kd] else dates = [dates,kd]
   endif
endrep until eof(lu)
close,lu
openr,lu,'cron.offset'
noff = 0
repeat begin
   readf,lu,a
   k=strpos(a,'offset')
   if k gt -1 then begin
      noff = noff+1
      ;  decode offset here
      k = strpos (a,' ',k)+1
      sd = strmid(a,k,10)
      d = float(sd)
      print,k,' ',d,sd
      if noff eq 1 then offsets = [d] else offsets = [offsets,d]
      help,offsets
   endif else offsets=[offsets,0]
endrep until eof(lu)
close,lu
openw,lu,'cron.dat'
for i=0,n_elements(offsets)-1 do printf,lu,i,dates(i),offsets(i)
free_lun,lu
return
end
