文本内容批量更换的问题, 回车换成;

来源:百度知道 编辑:UC知道 时间:2024/06/30 02:48:22
我有若干个文本文件,里边的内容是QQ号码,一个回车一个号码,但是我想把文本的内容回车换成“;”号,不包括双引。如何实现一次批量进行转换,一个个来改太耗时间了。

Private Sub Command1_Click()
Dim i As Long
Dim ReDat As String
Dim SavDat As String
Dim SavPath As String
SavPath = File1.Path & "\已整理的QQ号文件"
If Dir(SavPath, vbDirectory) = "" Then MkDir SavPath
If File1.ListCount > 0 Then
For i = 0 To File1.ListCount - 1
Open File1.Path & "\" & File1.List(i) For Input As #1
Do While Not EOF(1)
Input #1, ReDat
SavDat = SavDat & ";" & ReDat
Loop
Close
Open SavPath & "\" & File1.List(i) For Binary As #2
Put #2, , SavDat
Close
SavDat = ""
Next
MsgBox "OK!"
Else
MsgBox "没有找到txt文本文件!"
End If
End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path =