%**************************************************************************
%This function writes a header to the data file.
%
%Input:
%dat_file, data file for results
%header, copy of the header in the input data file
%
%Zachary Wolf, 9/6/08

function [] = long_coil_dat_header(dat_file, header)

%Open the data file
fid = fopen(dat_file, 'a');

%Write the measurement data file header information
fprintf(fid, '\r\n');
fprintf(fid, 'Measurement File Header Information:\r\n');

%If the header info has the standard format, use relevant pieces
ii = strmatch('Project:', header);
if length(ii) == 1
    fprintf(fid, '%s\r\n', header{ii});
end
ii = strmatch('Device Type:', header);
if length(ii) == 1
    fprintf(fid, '%s\r\n', header{ii});
end
ii = strmatch('Serial Number:', header);
if length(ii) == 1
    fprintf(fid, '%s\r\n', header{ii});
end
ii = strmatch('DATASET Number:', header);
if length(ii) == 1
    fprintf(fid, '%s\r\n', header{ii});
end
ii = strmatch('Run Number:', header);
if length(ii) == 1
    fprintf(fid, '%s\r\n', header{ii});
end
ii = strmatch('Measurement TYPE:', header);
if length(ii) == 1
    fprintf(fid, '%s\r\n', header{ii});
end
ii = strmatch('Operator:', header);
if length(ii) == 1
    fprintf(fid, '%s\r\n', header{ii});
end
ii = strmatch('Comment:', header);
if length(ii) == 1
    fprintf(fid, '%s\r\n', header{ii});
end

%Close the data file
fclose(fid);

%Done
