09/05/01 00:27:54 l9epXrzU0
>>488
おk、その点を修正して見た
var fso = new ActiveXObject("Scripting.FileSystemObject");
for(var i=0;i<WScript.Arguments.length;++i){
var o = fso.OpenTextFile(WScript.Arguments(i),1)
var text = o.ReadAll().replace(/(\d+)-(\d+)/g,function(a,b,c){
var from = Number(b);
var to = Number(c);
var result = b
if(from > to)return a;//変な範囲のときに空にしたいときはaを""に置き換える
while(from++<to)result += "," + from
return result
});
o.Close();
var o = fso.CreateTextFile(WScript.Arguments(i)+".output.txt",true);
o.Write(text);
o.Close()
}