gzygzy 发表于 2008-11-1 18:25:00

求一段代码

各位大侠,求助
   在01.txt中,打开02.txt.复制里面的文字,粘贴到01.txt中,关闭02.txt,然后打开03.txt,进行同样的操作,以此类推直至09.txt
能否给出上述代码,谢谢!

l4ever 发表于 2008-11-1 19:47:48

$File2 = FileRead ( "02.txt")
$File3 = FileRead ( "03.txt")
$File4 = FileRead ( "04.txt")
$File5 = FileRead ( "05.txt")
$File6 = FileRead ( "06.txt")
$File7 = FileRead ( "07.txt")
$File8 = FileRead ( "08.txt")
$File9 = FileRead ( "09.txt")

$Write = FileWrite("01.txt", $File2 & $File3 & $File4 & $File5& $File6& $File7& $File8 & $File9& @CRLF)
if $Write = "1" Then
msgbox (32,"成功","哈哈.so easy")
else
msgbox (16,"失败","靠靠.so hard")

[ 本帖最后由 l4ever 于 2008-11-1 20:17 编辑 ]

gzygzy 发表于 2008-11-1 19:57:03

文件夹里的文件有几百个啊,另外最好用记录键盘和鼠标的方式来实现,不要用FILEREAD

谢谢

[ 本帖最后由 gzygzy 于 2008-11-1 20:06 编辑 ]

l4ever 发表于 2008-11-1 20:02:34

原帖由 gzygzy 于 2008-11-1 19:57 发表 http://www.autoitx.com/images/common/back.gif
文件夹里的文件有几百个啊,
遍历一下就行了.不难,翻帮助文件

liongodmien 发表于 2008-11-2 13:00:16

用AU3简单模拟鼠标和键盘动作,太浪费了!

For $i = 2 To 500;如果文件名是有规律的排序,这个数改成你最大的那个文件名
        If $i < 10 Then $i = '0' & $i
        $string = FileRead ($i & ".txt")
        If StringStripCR(StringStripWS($string, 8)) <> '' Then FileWrite("01.txt", @CRLF & $string);如果是没有可见文字的就不向1.txt中写入
Next
MsgBox(64,'','完成!',3)
页: [1]
查看完整版本: 求一段代码