function k_array = import_k_file_except_nodes(k_file_to_read)
% Loops through a .K file. Identifies the *NODE keyword and collects
% all other rows in a cell array for further processing
%
%
% INPUTS:   k_file_to_read    - String, name of file to create.
%
% OUTPUTS:  k_array           - Cell array with the K file contents
%
% created by: ABR
% date : 2024-04-18
fileID = fopen(k_file_to_read);
first_row = true;
write_row = 0;
true_flag = false;
k_array = {};

while first_row || ischar(tline)
  first_row = false;
  tline = fgetl(fileID);
  if length(tline) == 5 && strcmp(tline(1:5),'*NODE')
    true_flag = 1;
    while (length(tline) > 55 || true_flag) && ischar(tline)
      true_flag = 0;
      tline = fgetl(fileID);
    end
  else
    if ischar(tline)
      write_row = write_row + 1;
      k_array{write_row} = tline;
    end
  end
end
fclose(fileID);
