Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <stdlib.h>
- #include <numeric>
- using namespace std;
- int main() {
- string line, dollar, star, Checksum;
- float *t0 = NULL;
- int tount = 0;
- int k;
- ifstream logs_("C:/Users/Dmitry/Desktop/testlog.txt");
- ofstream tout("outLOGTime.txt");
- ofstream pout("outLOGPot.txt");
- if (logs_.is_open())
- {
- while(getline(logs_,line))
- {
- //line.find("RE004%on%")
- k = 0;
- if(line.substr(0,6) == "$GPGGA", "$GPGSV")
- dollar = line.find_first_of('$');
- star = line.find_first_of('*');
- for ( string::iterator c=dollar.begin(); c!=star.end(); ++c)
- {
- accumulate(c, 0, bit_xor<unsigned char>()) )
- }
- if (line.substr(0,6) == "$GPGSV")
- {
- for (size_t i = 0, N = 7; i < line.size(); i++)
- {
- if (line[i] == ',') k++;
- if(k == N)
- {
- pout << line.substr(i+1, 2) << endl;
- if ((N += 4) > 19) break;
- }
- }
- }
- logs_.close();
- }
- }
- else
- cout<<"File is not open"<<'\n';
- tout.close();
- pout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement