I can do this, I did a similar thing with XML and importing/exporting them into TEXT files.
Easy, here's what'd it look like in C++:
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string supertrick;
ifstream example("example.txt");
if ( ! example )
{
cout << "Error opening example file." << endl;
return -1;
}
ofstream hosts("hosts.txt", ios::app);
if ( ! hosts )
{
cout << "Error opening example file." << endl;
return -1;
}
while ( ! example.eof() )
{
getline(example, supertrick);
hosts << example << endl;
}
hosts.close();
example.close();
return 0;
}
I think I uninstalled the GNU C++ Compiler, so someone will have to test this application out and debug it.
In the Command Prompt use the following line to compile:
C++ example.cpp -o example.exe
And then simply run:
All in red, obviously needs to be changed accordingly.
Bookmarks