; program to create file from Yale Bright Star Catalog of stars of ; visual magnitude less than 5.0 OPENR, inunit, '~steele/ybsc4/a5025b_bsc4.dat', /GET_LUN OPENW, outunit, 'tmp2', /GET_LUN n=0 fline = '' FOR i = 0,9109 DO BEGIN READF, inunit, fline mag = STRMID(fline,107,6) IF mag EQ ' ' THEN mag = 1000 IF mag LE 5. THEN BEGIN desig = STRMID(fline,0,14) pos = STRMID(fline,72,21) PRINTF, outunit,desig,pos,mag n=n+1 ENDIF ENDFOR CLOSE,inunit & FREE_LUN,inunit CLOSE,outunit & FREE_LUN,outunit OPENW,outunit,'tmp1',/GET_LUN PRINTF,outunit,n CLOSE,outunit & FREE_LUN,outunit SPAWN,'cat tmp1 tmp2 >! ~steele/ybsc4/ybsc4s.dat' PRINT,n END