thank you for help
Just
I have 132 files, each one contains 9 columns and 1000 raw. what I
need, I select I last column from all files and print them in one file
name out.txt
the outcome file becomes a matrix of 132 columns and 1000 raw. for this idea I wrote the following code
input_dir_model
= 'C:\Users\Desktop\Input_data'
; This directory contains 132 files
fileList_model = FILE_SEARCH(input_dir_model,'*', /FULLY_QUALIFY_PATH ) ; select all files in the input directory
output_dir_pw = 'C:\Users\Desktop\out_parameter'
FOR i = 0, n_elements(file_list_model) -1 DO BEGIN
date=file_lines( file_list_model
(i)) ; the number of lines in each file
t_data=fltarr(9,date) ; the number of columns in each files
openr, lun,
fileList_model
(i),/get_lun
readf, lun, t_data
free_lun, lun
X1 =reform(t_data[0,*]) ; the first column
X2
=reform(t_data[1,*])
; the second column
X3
=reform(t_data[2,*])
X4 =reform(t_data[3,*])
X5 =reform(t_data[4,*])
X6 =reform(t_data[5,*])
X7 =reform(t_data[6,*])
X8 =reform(t_data[7,*])
X9 =reform(t_data[8,*])
; the last column
OPENW, lun, '
output_dir_pw
\temp.txt\out.txt', /get_lun; , /append
PRINTF, lun, [X9[0:i,*]], format='(3x, f8.4)'
free_lun,lun
end
it's suppose that the code print X9's columns in out.txt.
Unfortunately, The code don't run correctly
Best regards