中国的人口就是多,而且是低级重复地“多”。。。
就这么不舍得动脑子?这个问题又不涉及到多么高深的技术,纯粹就是个思路
程序代码:
'//! 引用Microsoft Scripting Runtime
Private Function foo(ByVal strPath As String) As Long
Dim strFile As String
Dim strLast8 As String
Dim dic As Dictionary
Dim fNo As Integer
Dim fNo2 As Integer
Dim bytBuf() As Byte
Dim arrList As Variant
Dim i As Integer
Dim j As Integer
Set dic = New Dictionary
strFile = Dir$(strPath & "\*.txt")
Do While strFile <> ""
'获取文件名的最后8位
strLast8 = Right$(Left$(strFile, InStrRev(strFile, ".") - 1), 8)
On Error Resume Next
dic.Add strLast8, strFile
If Err Then
dic(strLast8) = dic(strLast8) & "|" & strFile
End If
On Error GoTo 0
strFile = Dir$()
Loop
For i = 0 To dic.Count - 1
arrList = Split(dic.Items(i), "|")
fNo = FreeFile()
Open strPath & "\result\" & dic.Keys(i) & ".txt" For Binary As fNo
For j = 0 To UBound(arrList)
fNo2 = FreeFile()
Open strPath & "\" & arrList(j) For Binary As fNo2
ReDim bytBuf(LOF(fNo2)) As Byte
Get fNo2, , bytBuf()
Close fNo2
Put fNo, , bytBuf()
Next
Close fNo
Next
End Function
[
本帖最后由 jiashie 于 2010-5-21 11:46 编辑 ]