查看全部评分
举报
Local $a = FileRead('1.txt'), $ss = '222' $a = StringRegExp($a, '(?s).+(?=' & $ss & ')', 3) If Not @Error Then $a = StringRegExpReplace($a[0], @CRLF, '') MsgBox(0, 0, '关键字上一行为第 ' & @extended & ' 行')
Local $a = FileOpen('1.txt', 0), $i = 1 While 1 If FileReadLine($a) = '222' Then ExitLoop $i += 1 WEnd MsgBox(0, 0, '关键字上一行为第 ' & $i - 1 & ' 行') FileClose($a)
Local $a = FileOpen('1.txt', 0), $i = 1, $sok = 0 While 1 $hs = FileReadLine($a) If @error Then ExitLoop If StringRegExp($hs, '222') Then $sok = 1 ExitLoop EndIf $i += 1 WEnd FileClose($a) If $sok = 1 Then MsgBox(0, 0, '关键字上一行为第 ' & $i - 1 & ' 行')
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度
GMT+8, 2025-5-8 03:00 , Processed in 0.187336 second(s), 20 queries .
Powered by Discuz! X3.5 Licensed
© 2001-2025 Discuz! Team.