找回密码
 加入
搜索
楼主: qq342252004

查找文本里的一句话在这句话的下一行写入另外一句话

[复制链接]
发表于 2009-2-10 23:50:00 | 显示全部楼层
#include <File.au3>
Local $Flag = 0, $Inserted = 0, $new = ""
For $a = 1 to _FileCountLines("1.txt")
        If not $Inserted And $Flag then
                $new &= "新行" & @CrLf
                $Inserted = 1
        EndIf
        If FileReadLine("1.txt", $a) = "我在这里" And not $Inserted then $Flag = 1
        $new &= FileReadLine("1.txt", $a) & @CrLf
Next
msgBox(0, '', $new)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 18:19 , Processed in 0.070673 second(s), 15 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表