Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @if (1 == 1) /*
- @echo off
- cscript //nologo //e:JScript "%~f0" %*
- @goto :eof
- */
- @end
- var arg = WScript.Arguments;
- if (arg.length != 1) WScript.Quit(1);
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var fin = fso.OpenTextFile(arg(0), 1);
- var out = WScript.StdOut;
- //var out = fso.CreateTextFile(arg(0) + ".new", true);
- var log = WScript.StdErr;
- //var log = fso.CreateTextFile(arg(0) + ".log", true);
- var no = 0;
- while (!fin.AtEndOfStream) {
- ++no;
- var line = fin.ReadLine();
- if (no <= 4) {
- out.Write(line + "\r\n");
- continue;
- }
- var separate = line.split("\t");
- if (separate[4] != "") {
- out.Write(line + "\r\n");
- continue;
- }
- separate[4] = "999";
- out.Write(separate.join("\t") + "\r\n");
- log.Write("line: " + no + ", changed.\r\n");
- }
- WScript.Quit(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement