主题:我是没招了,看你的了
用Quick Basic 7.1编了下面的程序,来比较aaa.txt和qqq.txt这两个文件。
aaa.txt的格式如下,共965597组:
05,09,14,21,24,27
07,16,19,21,24,25
13,21,23,30,31,32
01,06,09,15,25,33
04,05,14,18,21,32
......
qqq.txt的格式如下,共1450000组:
05,15,16,22,23,29
02,12,15,17,18,25
02,03,04,05,09,20
13,15,19,21,28,29
10,12,19,20,24,25
......
比较的目的是将aaa.txt中不包含qqq.txt的数据显示出来,并输出为999.txt文件。
Open "e:\999.txt" For Output As #3
Open "e:\aaa.txt" For Input As #1
For m = 1 To 965597
Input #1, i1, i2, i3, i4, i5, i6
Open "e:\qqq.txt" For Input As #2
For n = 1 To 1450000
Input #2, a, b, c, d, e, f
If i1 = a And i2 = b And i3 = c And i4 = d And i5 = e And i6 = f Then GoTo 98
If n = 1450000 Then GoTo 96
GoTo 97
96 Print #3, i1; ","; i2; ","; i3; ","; i4; ","; i5; ","; i6
97 Next n
98 Close #2
Next m
Close #1
Close #3
End
程序运行没有问题,可以实现希望达到的目的。但程序运行时间太长,完全运行完
估计需要750小时。我的计算机是P4、CPU3.0GHz,有点老。我对程序不太懂,只略
懂一点Basic,是新手。
各位大虾有没有什么招,既能实现希望达到的目的,又能使程序运行能在1到2小时之
内完成。要是大虾觉得这个程序不能用、太土,能不能为不才重新编一个,最好是
Basic的,别的我不懂。谢谢!
aaa.txt的格式如下,共965597组:
05,09,14,21,24,27
07,16,19,21,24,25
13,21,23,30,31,32
01,06,09,15,25,33
04,05,14,18,21,32
......
qqq.txt的格式如下,共1450000组:
05,15,16,22,23,29
02,12,15,17,18,25
02,03,04,05,09,20
13,15,19,21,28,29
10,12,19,20,24,25
......
比较的目的是将aaa.txt中不包含qqq.txt的数据显示出来,并输出为999.txt文件。
Open "e:\999.txt" For Output As #3
Open "e:\aaa.txt" For Input As #1
For m = 1 To 965597
Input #1, i1, i2, i3, i4, i5, i6
Open "e:\qqq.txt" For Input As #2
For n = 1 To 1450000
Input #2, a, b, c, d, e, f
If i1 = a And i2 = b And i3 = c And i4 = d And i5 = e And i6 = f Then GoTo 98
If n = 1450000 Then GoTo 96
GoTo 97
96 Print #3, i1; ","; i2; ","; i3; ","; i4; ","; i5; ","; i6
97 Next n
98 Close #2
Next m
Close #1
Close #3
End
程序运行没有问题,可以实现希望达到的目的。但程序运行时间太长,完全运行完
估计需要750小时。我的计算机是P4、CPU3.0GHz,有点老。我对程序不太懂,只略
懂一点Basic,是新手。
各位大虾有没有什么招,既能实现希望达到的目的,又能使程序运行能在1到2小时之
内完成。要是大虾觉得这个程序不能用、太土,能不能为不才重新编一个,最好是
Basic的,别的我不懂。谢谢!