!order=0 ii=0 close,1 filenm=' ' listfile='bzbzbz' close,13 & openr,13,listfile while ( not eof(13) ) do begin ;{ ii=ii+1 readf,13,filenm prefix=STRMID(filenm,0,13) IF (strpos(filenm,'subt') NE -1) THEN ofile=prefix+'small.subt.gif' $ ELSE ofile=prefix+'small.slit.gif' ;if(strpos(filenm,'mk3') ne -1 ) then ofile='jane' else ofile='fred' ;if(strpos(filenm,'hsh') ne -1 ) then ofile='wilma' read_gif,filenm,img,_a,_b,_c img=rebin(img,256,256) ;if ( ii lt 10 ) then filenm=ofile+'.00'+string(ii)+'.gif' $ ;else if( ii ge 100 ) then filenm=ofile+'.' +string(ii)+'.gif' $ ;else filenm=ofile+'.0'+string(ii)+'.gif' ;filenm=strcompress(filenm,/remove_all) print,filenm+' -> '+ofile write_gif,ofile,img,_a,_b,_c endwhile ;} close,13 end