✔ 最佳答案
please try following code.
just do it with excel vba, ok?
only generate 64 times. just amend the sub CallAll to generate 1800 times and the path.
Public aBingo(49) As Integer
Sub FileOut(sFile As String)
Dim i, j As Integer
Dim sLine As String
Open sFile For Output As #1
For i = 0 To 6
sLine = ""
For j = 0 To 6
sLine = sLine & Trim(Val(aBingo(i * 7 + j))) & ","
Next
Print #1, Left(sLine, Len(sLine) - 1)
' MsgBox Left(sLine, Len(sLine) - 1)
Next
Close #1
End Sub
Sub BingoGen()
Dim i, j As Integer
Dim a(48) As Integer
i = 0
Do
j = Int((49 * Rnd) + 1)
If a(j - 1) <> 1 Then
aBingo(i) = j
a(j - 1) = 1
i = i + 1
End If
If i >= 49 Then
Exit Do
End If
Loop
End Sub
Sub CallAll()
Dim i As Integer
Dim sFileName As String
For i = 1 To 64
sFileName = Trim(Str(Val(i)))
sFileName = "C:\TEMP\B_" & String(4 - Len(sFileName), "0") & sFileName & ".TXT"
Call BingoGen
Call FileOut(sFileName)
Next
End Sub
hope can help u