The link that Walter provided looks promising.
If you wish to pursue the processing on your own, here is a script that will read the GPS and GLONASS records into separate cell arrays.
You will have to add additional code where indicated to process each of the records that you read from your data file.
fp = fopen("C:\Users\LesPC\Documents\MATLAB\Answers\shortenRNX.txt", 'rt');
noLinesGPS = 7;
noLinesGLONASS = 3;
idxGPS = 1;
idxGLONASS = 1;
while true
txtLine = fgetl(fp);
if (txtLine == -1)
break;
end
if (isempty(txtLine))
break;
end
if (txtLine(1) == 'G')
dataGPS{idxGPS} = txtLine;
for nLine = 1:noLinesGPS
txtLine = fgetl(fp);
dataGPS{idxGPS} = sprintf('%s %s', dataGPS{idxGPS}, txtLine);
end
idxGPS = idxGPS + 1;
elseif (txtLine(1) == 'R')
dataGLONASS{idxGLONASS} = txtLine;
for nLine = 1:noLinesGLONASS
txtLine = fgetl(fp);
dataGLONASS{idxGLONASS} = sprintf('%s %s', dataGLONASS{idxGLONASS}, txtLine);
end
idxGLONASS = idxGLONASS + 1;
end
end
fclose(fp);
fprintf('%s: Done\n', mfilename);
I've edited this because the for loops to read the lines after the 'header' were using the wrong value (idx... vs noLines...). Also, a better test for the end of the file.
Best Answer