?
Cool, das funktioniert! Danke!
Hab ich übrigends hierfür gebraucht:
// sdx2vdr.cpp
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
using namespace std;
int main(int argc, char* argv[])
{
ifstream sdx;
ofstream vdr;
vector<string> line;
if(argc > 1) sdx.open(argv[1]);
else sdx.open("0192.sdx");
vdr.open("channels.conf", ios::trunc);
if(!sdx)
{
cout << "Datei " << argv[1] << " konnte nicht geöffnet werden." << endl;
vdr.close();
sdx.close();
return 1;
}
for(string tmp; getline(sdx, tmp, (char)0x0d);) line.push_back(tmp);
for(unsigned int c = 0; c < line.size(); c++)
{
if(line.at(c).substr(28,5) == "TMPG2"
&& (line.at(c).substr(102,3) == "DEU" || line.at(c).substr(102,3) == "ENG")
&& line.at(c).substr(111,4) == "____")
{
vdr << line.at(c).substr(43, 8) << line.at(c).substr(115, 12) << ":"; // Ch-Name
vdr << line.at(c).substr(33, 6) << ":"; // Freq
vdr << (line.at(c)[42] == '1' ? "h" : "v"); //Pol
vdr << ":S19.2E:";
vdr << line.at(c).substr(69, 5) << ":"; // MSymb/s
vdr << line.at(c).substr(75, 4) << ":"; // V-PID
vdr << line.at(c).substr(79, 4) << ":"; // A-PID
vdr << "0:"; // ???
vdr << "0:"; // Crypt-ID
vdr << line.at(c).substr(87, 5) << ":"; // SID
vdr << line.at(c).substr(92, 5) << ":"; // NID
vdr << line.at(c).substr(97, 5) << ":"; // TID
vdr << line.at(c).substr(102, 3) << ":"; // Lang
vdr << "0"; // Crypt
vdr << endl;
}
}
vdr.close();
sdx.close();
return 0;
}