如何读取txt中指定位置字符
本帖最后由 qdhouri 于 2009-11-3 22:49 编辑txt内容如下
052/020/a.exe
如何读取052/020这个几个字符? while 1
if stringright($text, 1)= "/" then
exitloop
else
$text = stringtrimright($text, 1)
endif
wend
msgbox("","", stringtrimright($text, 1)) $text = '052/020/a.exe'
$ok = StringRegExp($text, '(.+)/.*', 3)
If @error = 0 Then MsgBox(0, 0, $ok) while 1
if stringright($text, 1)= "/" then
exitloop
else
$text = stringtrimright($text, 1)
endif
wend
msgbox("","", stringtrimright($text, 1))
netegg 发表于 2009-11-3 19:43 http://autoitx.com/images/common/back.gif
超级感谢~ $text = '052/020/a.exe'
$ok = StringRegExp($text, '(.+)/.*', 3)
If @error = 0 Then MsgBox(0, 0, $ok)
afan 发表于 2009-11-3 21:24 http://autoitx.com/images/common/back.gif
超级感谢~ 只是无意路过罢了 再问下为什么换成 \ 就不好用了啊?
$text = '052\020\a.exe'
$ok = StringRegExp($text, '(.+)\.*', 3)
If @error = 0 Then MsgBox(0, 0, $ok) 本帖最后由 newx 于 2009-11-3 23:32 编辑
$text = '052\020\a.exe'
$ok = StringRegExp($text, '(.*)\\(.*)\\(.*)', 3)
If @error = 0 Then MsgBox(0, 0, $ok)
呵。。。。不错。论坛里东西真全。拿走了 学习........................
页:
[1]