% Counts the number of rows in a data file
function NoL = CalcNumOfLines(IONEXFile)

%IONEXFile = 'RIM021430.INX';

DataFile = fopen(IONEXFile,'r');
fseek(DataFile, 0, 'eof');
BytesInFile = ftell(DataFile);
fseek(DataFile, 0, 'bof');
i = fread(DataFile, BytesInFile, '*uchar');
NoL = sum(i == sprintf('\n')); 
fclose(DataFile);

