[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. info="互助互利,支付宝扫码头像,感谢打赏"
  2. '有问题,可加QQ956535081及时沟通
  3. Set fso=CreateObject("Scripting.Filesystemobject")
  4. Set dic=CreateObject("Scripting.Dictionary")
  5. infile=".\文本A.txt"
  6. outfile=".\结果.txt"
  7. dic.Add "2","aaa"
  8. dic.Add "3","bbb"
  9. Set f1=fso.OpenTextFile(infile,1)
  10. Set f2=fso.CreateTextFile(outfile,2)
  11. n=0
  12. Do While f1.AtEndOfStream<>true
  13.     n=n+1
  14.     line=f1.ReadLine
  15.     If dic.Exists(CStr(n)) Then
  16.         f2.WriteLine dic.Item(CStr(n))
  17.     Else
  18.         f2.WriteLine line
  19.     End If
  20. Loop
  21. f1.Close
  22. f2.Close
  23. msgbox info
复制代码
提供bat代写,为你省时省力省事,支付宝扫码头像支付
微信: unique2random

TOP

返回列表