怎么把文本文件里的某一行删掉

yehp 2002-05-13 05:33:19
内容如标题:
...全文
39 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
veilen 2002-05-13
  • 打赏
  • 举报
回复
<%set myfile=server.createobject("scripting.filesystemobject")
set mytext= myfile.opentextfile("c:\te.txt")
totl = mytext.readall
tarray = split(totl,chr(10),-1,0)
mytext.close

set mytext2 = myfile.createtextfile("c:\te.txt")
'要超过5行的file
for i= 0 to 3
mytext2.writeline(tarray(i))
next
'这里把第5行删掉了
for i = 5 to ubound(tarray)
mytext2.writeline(tarray(i))
next
mytext2.close
%>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧