function read_omni_minutely_ByBz,inpath,maxrec=maxrec ;this function is in test to read the txt file ;---------------------------------------------------- if n_elements(maxrec) eq 0 then maxrec = 1100000L stru = {year:0L,doy:0L,hour:0L,minute:0L,IMF:0.0,by:0.0,bz:0.0,V_sw:0.0,Pres_sw:0.0,sym_H:0L} ;a structure to hold one line of the data file record =replicate(stru,maxrec) ;hold all data openr,lun,inpath,/get_lun ;need a container to hold one line of text trash = 'garbage' ;let's skip the first 3 lines ;P ;header = 3 ;for jj = 0,header-1 do readf,lun,trash fmt='(i4,i4,i3,i3,3(f8.2),f8.1,f6.2,i6)' i=0L while(not eof(lun)) do begin readf,lun,stru;,format=fmt ;put the line we ju st read into our arrays record(i) = stru i=i+1L ;Check to make sure maxrec isn't exceeded if i ge maxrec then message,'WARNING: MAXREC TOO SMALL! Please increase.' endwhile record=record[0:i-1L] free_lun,lun return,record end