function read_grace_minden,inpath,maxrec=maxrec ;this function is in test to read the txt file ;---------------------------------------------------- if n_elements(maxrec) eq 0 then maxrec = 1100000L stru = {time:0.0,maxden:0.0,glat:0.0,glon:0.0,glt:0.0,mlat:0.0,mlon:0.0,mlt:0.0,by:0.0,bz:0.0,Press:0.0,symh:0.0} ;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