Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Periodically get a random line from the source file and save it into the destination file.
- 'Double click to run. Terminate the `wscript.exe` to stop script.
- source = "d:\input\source.txt"
- dest = "d:\out folder\dest.txt"
- set fs = createobject("scripting.filesystemobject")
- set src = fs.opentextfile(source)
- 'if unix file, use `vblf` instead of `vbcrlf`
- lines = split(src.readall, vbcrlf)
- src.close
- randomize
- do
- row = int(rnd * ubound(lines))
- set out = fs.createtextfile(dest, true)
- out.writeline lines(row)
- out.close
- 'number in milliseconds. 1 second = 1000ms
- wsh.sleep 60 * 1000
- loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement