
% reads in hf5lfux files files and writes out
% one datafile with all of the pertinent info in it.

disp('Reading hf5 files')
clear all;
fclose('all');
s='d:\data\proc_files\*.txt';
dr=dir(s);			%lists all files in directory
[n m]=size(dr);
nx=n;%				%# of files in data directory (includes . and ..)     
%stux_all=zeros(100,29);

%******************  setup read data loop  **********
ss='d:\data\proc_files\';
jamx=1;
for ibg = 1:n;%nx 			%major read loop
   nm=dr(ibg).name;
    if(nm(1:8)=='flux_5hf' & length(nm)<17)
        e=[ss dr(ibg).name]; %gets names of files in directory
        stux=load(e);   		%loads all data from files into stux
        [nl ml]=size(stux);
        stux_alla(jamx:jamx+nl-1,1:30)=stux;  % make data array
        jamx=jamx+nl  
    end;
end; %  data line loop

stux_all=sortrows(stux_alla,1);
save d:\data\proc_files\flux_5hf_stratus_05.txt stux_all -ascii -tabs

