I have a test file (ASCII) that has lines that look like this:
$GPRMC,060001,A,3348.795,N,11754.064,W,000.0,000.0,110698,013.7,E*62
$GPRMB,A,,,,,,,,,,,,V*71
$GPGGA,060001,3348.795,N,11754.064,W,1,07,1.0,65.8,M,-31.9,M,,*4F
$GPGSA,A,3,14,15,16,18,22,25,29,,,,,,2.2,1.0,1.9*38
$GPGSV,2,1,07,14,70,322,55,15,31,212,53,16,32,317,54,18,10,282,47*7C
$GPGSV,2,2,07,22,40,120,53,25,36,045,52,29,28,073,50,,,,*4B
$PGRME,19.5,M,44.7,M,48.8,M*10
$GPGLL,3348.794,N,11754.064,W,060002,A*3E
$PGRMZ,217,f,3*1F
$PGRMM,WGS 84*06
I am reading the first line of the file like this:
OpenDialog1->Options.Clear();
OpenDialog1->Options << ofAllowMultiSelect << ofFileMustExist;
OpenDialog1->Filter = "RESON Simulator GPS Files (*.txt)|*.txt|All files (*.*)|*.*";
OpenDialog1->FilterIndex = 2; // start the dialog showing all files
if (OpenDialog1->Execute())
{
edtLoadFile->Text = OpenDialog1->FileName;
for (int I = 0; I < OpenDialog1->Files->Count; I ++)
{
stream = fopen(OpenDialog1->Files->Strings.c_str(), "r"
if (stream)
{
// read the first line from the file
fgets(FirstLine, sizeof(FirstLine), stream);
rchEdit1->Lines->Append(FirstLine);
fclose(stream);
}
}
}
I need to know how to read the other lines of the file, line by line.
Thanks!
Fergmj
$GPRMC,060001,A,3348.795,N,11754.064,W,000.0,000.0,110698,013.7,E*62
$GPRMB,A,,,,,,,,,,,,V*71
$GPGGA,060001,3348.795,N,11754.064,W,1,07,1.0,65.8,M,-31.9,M,,*4F
$GPGSA,A,3,14,15,16,18,22,25,29,,,,,,2.2,1.0,1.9*38
$GPGSV,2,1,07,14,70,322,55,15,31,212,53,16,32,317,54,18,10,282,47*7C
$GPGSV,2,2,07,22,40,120,53,25,36,045,52,29,28,073,50,,,,*4B
$PGRME,19.5,M,44.7,M,48.8,M*10
$GPGLL,3348.794,N,11754.064,W,060002,A*3E
$PGRMZ,217,f,3*1F
$PGRMM,WGS 84*06
I am reading the first line of the file like this:
OpenDialog1->Options.Clear();
OpenDialog1->Options << ofAllowMultiSelect << ofFileMustExist;
OpenDialog1->Filter = "RESON Simulator GPS Files (*.txt)|*.txt|All files (*.*)|*.*";
OpenDialog1->FilterIndex = 2; // start the dialog showing all files
if (OpenDialog1->Execute())
{
edtLoadFile->Text = OpenDialog1->FileName;
for (int I = 0; I < OpenDialog1->Files->Count; I ++)
{
stream = fopen(OpenDialog1->Files->Strings.c_str(), "r"
if (stream)
{
// read the first line from the file
fgets(FirstLine, sizeof(FirstLine), stream);
rchEdit1->Lines->Append(FirstLine);
fclose(stream);
}
}
}
I need to know how to read the other lines of the file, line by line.
Thanks!
Fergmj