如何提取文本中奇数行,且前10位字符
如题,如何提取文本中奇数行字符,且前10位字符问题一解决。
且前10位字符如何办呢
[ 本帖最后由 fanchenglu 于 2009-1-9 15:09 编辑 ] au3里的读写位置,没有更改函数?
$file = FileOpen("test.txt", 0)
; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
; Read in lines of text until the EOF is reached
$i=True
While 1
If $i Then
$line = FileReadLine($file)
If @error = -1 Then
ExitLoop
EndIf
MsgBox(0, "Line read:", $line)
Else
$line = FileReadLine($file) ;au3里怎么没找到移动读写位置的函数?,这里读一行可以把读写位置移动下来
If @error = -1 Then
ExitLoop
EndIf
EndIf
$i=Not($i)
Wend
FileClose($file)
[ 本帖最后由 akmm88 于 2009-1-8 18:50 编辑 ] $file = FileOpen("test.txt", 0)
; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
; Read in lines of text until the EOF is reached
$i=1
While 1
If $i Then
$line = FileReadLine($file,$i)
If @error = -1 Then
ExitLoop
EndIf
MsgBox(0, "Line read:", $line)
Else
$line = FileReadLine($file,$i) ;au3里怎么没找到移动读写位置的函数?,这里读一行可以把读写位置移动下来
If @error = -1 Then
ExitLoop
EndIf
EndIf
$i=$i+2;如此修改,已经解决
Wend
FileClose($file)
[ 本帖最后由 fanchenglu 于 2009-1-9 01:06 编辑 ]
页:
[1]