function dlmwrite_without_blank_last_line(file_name, array, dlmwrite_options)
% Writes an array to file. 
% Special handing of the final row to ensure that no blank line is
% inserted, as is the case when using dlmwrite. 
%
% INPUTS:   file_name   - String, name of file to create.
%           array       - array with information.
%           dlmwrite_options - Cell array with arguments to dlmwrite. 
%
% created by: ABR
% date : 2024-04-18

dlmwrite(file_name, array(1:end-1,:),dlmwrite_options{:})
dlmwrite(file_name, array(end,:),'-append','newline','', dlmwrite_options{:})
