根据字符串查询文件,文件中有该字符串,则修改该字符串所在行的下两行的数据[已解决]
本帖最后由 dhh45 于 2010-9-21 12:04 编辑根据字符串查询文件,文件中有该字符串,则修改该字符串所在行的下两行的数据
如何编写??
#include <file.au3>
$path = @ScriptDir & "\ceshi.txt"
Global $a
If FileExists($path) = 0 Then
FileWrite($path, "1111" & @CRLF & "2222" & @CRLF & "333" & @CRLF & "44" & @CRLF & "5555")
EndIf
For $a = 1 To _FileCountLines($path)
$line = FileReadLine($path, $a)
If @error = -1 Then ExitLoop
If $line = "2222" Then ExitLoop
Next
_FileWriteToLine($path, $a + 1, "asdhkgahgh", 1)
_FileWriteToLine($path, $a + 2, "4541545sdsds", 1)
$line=inputbox("匹配的字符串","请输入匹配的字符串") 太谢谢了啊,呵呵,已解决
页:
[1]