;+ ; NAME: ; read_gen ; ; PURPOSE: ; to read a data file that contains comments and ; numerical data only ; ; CATEGORY: ; utility function. ; ; CALLING SEQUENCE: ; data=read_gen(filename,n_comm,n_columns,n_lines) ; ; ; INPUTS: ; filename: input data source file name. ; n_comm: number of lines of comments. ; n_columns: number of data columns. ; n_lines: number of lines of data. ; ; OUTPUTS: ; data: array that holds the data read from ; the source file. ; ; COMMON BLOCKS: ; None. ; ; PROCEDURE: ; ; ROUTINES CALLED: ; None. ; ; MODIFICATION HISTORY: ; 12/12/02, Liying Qian, Initial version. ; ;+ function read_gen,filename,n_comm,n_columns,n_lines data=fltarr(n_columns,n_lines) openr,1,filename s='' for i=0,n_comm-1 do readf,1,s readf,1,data close,1 return,data end