pusofalse 发表于 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)
页: 1 [2]
查看完整版本: 查找文本里的一句话在这句话的下一行写入另外一句话