Commit 33bac21c authored by Ferhat Mihoubi's avatar Ferhat Mihoubi
Browse files

Adds end of line codes for various environments

parent 19032f4b
......@@ -107,12 +107,20 @@ fclose(fid);
% Set newline code (ok for *nix, check for mac and windows)
if isunix
newline_code = 10;
elseif ispc
newline_code = 13;
elseif ismac
newline_code = 10;
error('readcsv:: Not implemented for your OS!')
% Get the positions of the end-of-line code;
end_of_line_locations = find(bfile==newline_code);
if ispc && isempty(end_of_line_locations)
end_of_line_locations = find(bfile==newline_code);
tmp = find(bfile==newline_code);
% Get the number of lines in the file.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment