来个vbs,闲的。- Set fso = CreateObject("Scripting.FileSystemObject")
- Set dic = CreateObject("Scripting.Dictionary")
- Set file = fso.OpenTextFile("a.txt")
-
- Do until file.AtEndOfStream
- str = file.ReadLine
- a = Left(str,InStr(str,"_"))
- If not dic.Exists(a) Then
- dic.Add a,str
- Else dic.Item(a) = dic.Item(a) & vbCrLf & str
- End If
- Loop
-
- For Each b in dic.Keys
- If InStr(dic.Item(b),vbCrLf) Then
- fso.OpenTextFile("b.txt",8,True).WriteLine dic.Item(b)
- End If
- Next
复制代码
|