Super. Dovolil jsem si tam malou upravu v tom regularnim vyrazu (pouzil jsem vyraz losa), protoze
replace(/ +/g,";")
diky mezere na zacatku radku vlozilo i strednik na zacatek a tagy byly vuci textu o jedno posunute.
Takto to funguje k me spokojenosti:
fs = new ActiveXObject("Scripting.FileSystemObject");
source = fs.GetFile("source.txt");
dest = fs.CreateTextFile("dest.xml", true);
filestream = source.OpenAsTextStream(1, 0);
while(!filestream.AtEndOfStream)
{
line = filestream.ReadLine();
objects = line.replace(/^\s+|\s+$/g, "").split(/\s+/);
dest.writeline("<Control_Point_Data>");
dest.writeline(" <Control_Point_ID>"+objects[0]+"</Control_Point_ID>");
dest.writeline(" <Control_Point_X_Value>"+objects[1]+"</Control_Point_X_Value>");
dest.writeline(" <Control_Point_Y_Value>"+objects[2]+"</Control_Point_Y_Value>");
dest.writeline(" <Control_Point_Z_Value>"+objects[3]+"</Control_Point_Z_Value>");
dest.writeline("</Control_Point_Data>");
}
filestream.Close();
dest.Close();
Jeste jednou vsem velice dekuji + + .
M.