i knocked up a quick little jscript to do it. i couldn't figure out how to read the number of lines in a file, so you'll have to input that too.
code:
var fso, f1, ts, final;
fso = new ActiveXObject("Scripting.FileSystemObject");
var ForReading = 1;
function MakeCList(theFile,theNewFile,numContacts)
{
var final = '<?xml version="1.0"?>';
final += '<messenger>';
final += '<service name=".NET Messenger Service">';
final += '<contactlist>';
ts = fso.OpenTextFile(theFile, ForReading);
for (i=0; i<numContacts; i++)
{
final+='<contact type="1">' + ts.ReadLine() + '</contact>';
}
ts.Close();
final += '</contactlist>';
final += '</service>';
final += '</messenger>';
f1 = fso.CreateTextFile(theNewFile, true);
f1.Write (final);
f1.Close();
}
MakeCList("C:\\contacts.txt","C:\\contacts.ctt",10);
the syntax is MakeCList("
[path to file with email addresses]","
[path to new contacts.ctt]",
[number of email addresses]);
obviously this assumes one email address per line. if they were comma seperated it would be really easy.
edit:
code:
var fso, f1, ts, final, a;
fso = new ActiveXObject("Scripting.FileSystemObject");
var ForReading = 1;
function MakeCList(theFile,theNewFile)
{
var final = '<?xml version="1.0"?>';
final += '<messenger>';
final += '<service name=".NET Messenger Service">';
final += '<contactlist>';
ts = fso.OpenTextFile(theFile, ForReading);
a=ts.ReadAll().split(",");
for (i=0; i<a.length; i++)
{
a[i]=a[i].replace(" ","");
final+='<contact type="1">' + a[i] + '</contact>';
}
ts.Close();
final += '</contactlist>';
final += '</service>';
final += '</messenger>';
f1 = fso.CreateTextFile(theNewFile, true);
f1.Write (final);
f1.Close();
}
MakeCList("C:\\contacts.txt","C:\\contacts.ctt");
that's for comma separated or comma space separated. doesn't need to know the number of addresses.