Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <stdlib.h>
- using namespace std;
- int main() {
- string line;
- float *t0 = NULL;
- int tount = 0;
- int k;
- ifstream logs_("C:/Users/Dmitry/Desktop/Zhuikov project/logGLO.txt");
- ofstream tout("outLOGTime.txt");
- ofstream pout("outLOGPot.txt");
- if (logs_.is_open())
- {
- while (!logs_.eof())
- {
- k = 0;
- logs_ >> line;
- /*if(line.substr(0,6) == "$GPGGA")
- {
- if (t0)
- {
- tout << atof(line.substr(7,10).c_str()) - *t0 << endl;
- }
- else
- {
- t0 = new float;
- *t0 = atof(line.substr(7,10).c_str());
- }
- tount++;
- }*/
- /*else*/ if (line.substr(0,6) == "$GPGSV")
- {
- for(int N = 7; N <= 19; N+=4)
- {
- for (size_t i = 0; i < line.size(); i++)
- if (line.at(i) == ',') k++;
- if(k == N)
- {
- pout << atof(line.substr(0,2).c_str()) << endl;
- }
- }
- }
- logs_.close();
- tout << "K-vo Zna4eniy -- " << tount << endl;
- }
- }
- else
- cout<<"File is not open"<<'\n';
- tout.close();
- pout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement