I'll get to the point here. I forgot the additional white spaces that make the xml document valid. A couple of " " to make things right.
#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