[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
本帖最后由 CrLf 于 2015-10-21 21:09 编辑
  1. on error resume next
  2. set fso = CreateObject("scripting.filesystemobject")
  3. set ts = fso.opentextfile("d:\1.txt")
  4. str = ""
  5. do until ts.atendofstream
  6.   for i=1 to 99
  7.     ts.skipline
  8.   next
  9.   str = str & ts.readline & vbcrlf
  10. loop
  11. ts.close
  12. msgbox str
复制代码

TOP

本帖最后由 CrLf 于 2015-10-21 21:09 编辑
  1. dim title,y
  2. title = CreateObject("scripting.filesystemobject").opentextfile("d:1.txt").readall
  3. y=split(title,vbcrlf)
  4. stepnum=100
  5. str = ""
  6. for i=stepnum-1 to ubound(y) step stepnum
  7.   str = str & y(i) & vbcrlf
  8. next
  9. msgbox str
复制代码

TOP

已修改,如果用 WSH.Echo 代替 msgbox,在 cscript 宿主中可以输出到 console
1

评分人数

TOP

返回列表