Since I suck at MySQL I'm just going to link to the manual page on the MySQL site. Also note the MySQL manual is over 5,000 pages. If you are an expert at MySQL kudos for reading all of that. Import XML data into MySQL database
Here's C++ code. The output is a lot simpler than writing data to a web page as I did in previous examples.
//Simple example that converts a wordlist from plaintext to plaintext and hash pair tab delimited.
#include <string>
#include <sstream>
#include <iostream>
#include <cctype>
#include <fstream>
#include "md5.h"
using namespace std;
int main (int argc, char* argv[3])
{
{ofstream myfile;
myfile.open (argv[2]);
{ string line; ifstream infile (argv[1]);
{ string line; ifstream infile (argv[1]);
if (infile.is_open())
{ while ( getline (infile,line) )
//output plaintext hash pairs to xml
myfile << "<row column1=" << "\"" << line << "\"" << "column2=" << "\"" <<md5(line) << "\"" << "/>" << endl;
//<row column1="value1" column2="value2" .../>
infile.close();
myfile.close();
} else cout << "Unable to open file" << endl;
}
}
}
return 0; }
No comments:
Post a Comment