10iii
2013-10-22 10:03:37 +08:00
//cut.js
var ws = WScript.CreateObject("WScript.Shell"), fso = new ActiveXObject("Scripting.FileSystemObject");
var fin = fso.OpenTextFile(".\\Very-Large.csv", 1);
var i=0,j=1;
var fout = fso.OpenTextFile(".\\part"+(i++)+".csv", 2, true);
while (!fin.AtEndOfStream) {
j++;
fout.WriteLine(fin.ReadLine());
if ((j%1000000) === 0) {
fout.Close();
fout = fso.OpenTextFile(".\\part"+(i++)+".csv", 2, true);
}
}
fin.Close();fout.Close();
ws.popup('Done');