x='$RAIM';y='$GPGGA';fid=fopen('myfile.txt');while ~feof(fid) tline = fgetl(fid); if contains(tline,x) fprintf(id,'%s\n',tline)endendfclose(fid)
% Input file contents
$RAIM,002212,003080,000818,001156,020000,020000,000777,001098,111,3,11111111*32$GPGGA,151943.50,1257.32717,N,07738.23927,E,2,09,0.87,823.3,M,,M,,*44.
if second last column of RAIM line is 5 not 3 then only select GPGGA line otherwise go to next line.
Best Answer