(已解决)已解决 行互换问题
本帖最后由 langtangt 于 2016-4-6 08:42 编辑问题:把绿色字体整行变换到红色字体下面的行,同时删除原绿色字字体。原样格式如下:
------------------------------------------------------------------------
zw#6: xs386544638 (4740 cm)
blxc dp:
yclz qz 100
xs386544638 qz 100
blxc qz 100
xs271032987 qz 100
my520 qz 100
xs344387655 qz 100
blxc posts small blind 100
xs386544638 posts big blind 200
yclz g z 200
my520 g z 200
xs344387655 g z 200
xs271032987 g z 200
blxc g z 100
xs386544638 r p
--- ffp ---
blxc c【dc】zyd 3300
-------------------------------------------------------------------------
zw#6: yclz (57010 cm)
blxc dp:
j幺m qz 100
yclz qz 100
smlyy1 qz 100
blxc qz 100
awhy qz 100
xs271032987 qz 100
blxc posts small blind 100
smlyy1 posts big blind 200
yclz j z 1000
j幺m g z 1000
awhy g z 1000
xs271032987
blxc
smlyy1
--- lp ---
--- df ---
-------------------------------------------------------------------------
jspk9000c 2016/03/26 04:03:54
------------------------------- d 1 j -------------------------------
zjzwh: #3
zw#1: pwz (12500 cm)
zw#2: blxc (91760 cm)
zw#3: tomdlang (46400 cm)
zw#4: sddhdm (16620 cm)
zw#5: xs271032987 (14360 cm)
zw#6: whyj (32115 cm)
blxc dp:
pwz qz 100
whyj qz 100
xs271032987 qz 100
sddhdm qz 100
blxc qz 100
tomdlang qz 100
sddhdm posts small blind 100
xs271032987 posts big blind 200
whyj
pwz j z 400
blxc g z 400
tomdlang j z 2500
sddhdm
xs271032987
pwz
blxc
请用任何替数组法、替换法、插入法、互换法。接触AutoIT时间不长。但这个问题折磨俺一个星期了,搜了论坛相关的问题没能解决,有的是重复插入,有的不删除原绿色字体。再次谢谢。 Local $sSource = _
'------------------------------------------------------------------------' & @CRLF & @CRLF & _
'zw#6: xs386544638 (4740 cm)' & @CRLF & @CRLF & _
'blxc dp: ' & @CRLF & @CRLF & _
'yclz qz 100' & @CRLF & _
'xs386544638 qz 100' & @CRLF & _
'blxc qz 100' & @CRLF & _
'xs271032987 qz 100' & @CRLF & _
'my520 qz 100' & @CRLF & _
'xs344387655 qz 100' & @CRLF & _
'blxc posts small blind 100' & @CRLF & _
'xs386544638 posts big blind 200' & @CRLF & _
'yclz g z 200' & @CRLF & _
'my520 g z 200' & @CRLF & _
'xs344387655 g z 200' & @CRLF & _
'xs271032987 g z 200' & @CRLF & _
'blxc g z 100' & @CRLF & _
'xs386544638 r p' & @CRLF & @CRLF & _
'--- ffp ---' & @CRLF & @CRLF & _
'blxc c【dc】zyd 3300' & @CRLF & @CRLF & _
'-------------------------------------------------------------------------' & @CRLF & @CRLF & _
'zw#6: yclz (57010 cm)' & @CRLF & @CRLF & _
'blxc dp: ' & @CRLF & @CRLF & _
'j幺m qz 100' & @CRLF & _
'yclz qz 100' & @CRLF & _
'smlyy1 qz 100' & @CRLF & _
'blxc qz 100' & @CRLF & _
'awhy qz 100' & @CRLF & _
'xs271032987 qz 100' & @CRLF & _
'blxc posts small blind 100' & @CRLF & _
'smlyy1 posts big blind 200' & @CRLF & _
'yclz j z 1000' & @CRLF & _
'j幺m g z 1000' & @CRLF & _
'awhy g z 1000' & @CRLF & _
'xs271032987 ' & @CRLF & _
'blxc ' & @CRLF & _
'smlyy1 ' & @CRLF & @CRLF & _
'--- lp ---' & @CRLF & @CRLF & _
'--- df ---' & @CRLF & @CRLF & _
'-------------------------------------------------------------------------' & @CRLF & _
'jspk9000c 2016/03/26 04:03:54' & @CRLF & _
'------------------------------- d 1 j -------------------------------' & @CRLF & _
'zjzwh: #3' & @CRLF & _
'zw#1: pwz (12500 cm)' & @CRLF & _
'zw#2: blxc (91760 cm)' & @CRLF & _
'zw#3: tomdlang (46400 cm)' & @CRLF & _
'zw#4: sddhdm (16620 cm)' & @CRLF & _
'zw#5: xs271032987 (14360 cm)' & @CRLF & _
'zw#6: whyj (32115 cm)' & @CRLF & @CRLF & _
'blxc dp: ' & @CRLF & @CRLF & _
'pwz qz 100' & @CRLF & _
'whyj qz 100' & @CRLF & _
'xs271032987 qz 100' & @CRLF & _
'sddhdm qz 100' & @CRLF & _
'blxc qz 100' & @CRLF & _
'tomdlang qz 100' & @CRLF & _
'sddhdm posts small blind 100' & @CRLF & _
'xs271032987 posts big blind 200' & @CRLF & _
'whyj ' & @CRLF & _
'pwz j z 400' & @CRLF & _
'blxc g z 400' & @CRLF & _
'tomdlang j z 2500' & @CRLF & _
'sddhdm ' & @CRLF & _
'xs271032987 ' & @CRLF & _
'pwz ' & @CRLF & _
'blxc '
;~MsgBox(0, '源字符串', $sSource)
Local $sSRERe = StringRegExpReplace($sSource, '(?s)(blxc\h+dp:\V+\v+)(.+?\n)(\V+?blind\h+\d+\v+\V+?blind\h+\d+\v+)', '${2}${3}${1}')
MsgBox(0, '替换结果', $sSRERe)
回复 2# afan
高手,学习了。 回复 1# langtangt
好个"已解决", 你自己解决的莫.............
afan 白忙了.... 呵呵...........人啊............何至如此............ 回复langtangt
好个"已解决", 你自己解决的莫.............
afan 白忙了.... 呵呵...........人啊 ...
131738 发表于 2016-4-6 10:59 http://www.autoitx.com/images/common/back.gif
前辈有心了呵呵 回复 5# afan
此 "人" 非人也!!!!!
你也太什么了................吧................. 回复 6# 131738
现在为功利者多,为学习者少。 回复 7# haijie1223
呵呵, 不是功利,学习问题, 完全的人格有问题.............. 回复 6# 131738
你看楼主为这事自己折腾了一星期也不发问,估计话不多…呵呵 回复131738
你看楼主为这事自己折腾了一星期也不发问,估计话不多…呵呵
afan 发表于 2016-4-6 12:25 http://www.autoitx.com/images/common/back.gif
怀疑............. 回复131738
你看楼主为这事自己折腾了一星期也不发问,估计话不多…呵呵
afan 发表于 2016-4-6 12:25 http://www.autoitx.com/images/common/back.gif
A大最善解人衣{:face (303):}
页:
[1]