linklist2html

Here is a small utility to convert your links from text format to html
I made it quickly to be able to publish links sent by a friend.

// Karoliina Salminen 31.5.2009
// Little utility that converts text files containing links to html link list

#include
#include
#include

using namespace std;

int main(int argc, char **argv)
{

if(argc!=3){
cout << "USAGE: links2html input.txt output.html" << endl;
}
fstream infile(argv[1],ios::in);
ofstream outfile(argv[2]);

if (infile.is_open())
{
while (! infile.eof() )
{
char str[2000]={0};
infile.getline (str,2000);
string inputline = string(str);
if(inputline!=""){
string outputline = "";
outputline = ""+inputline+"
";
cout << outputline << endl;
outfile << outputline << endl;
} else {
string outputline="
";
outfile << outputline << endl;
}
}
infile.close();
outfile.close();
}
return 0;
}

  1. No trackbacks yet.

You must be logged in to post a comment.
%d bloggers like this: