
'都是文本文件是吧
'去除空行
Option Explicit
Sub abc()
Dim a, b, i, j, pth, f, m, n As Integer
pth = "d:\abc\"
If Dir(pth, vbDirectory) = vbNullString Then MsgBox pth: Exit Sub
f = pth & "abc.txt"
If Dir(f) = vbNullString Then MsgBox f: Exit Sub
n = FreeFile
Open f For Input As n
a = Split(StrConv(InputB(LOF(1), 1), vbUnicode), vbNewLine)
Close n
ReDim b(1 To 10 ^ 6) As String
For i = 0 To UBound(a)
If Len(a(i)) Then
For j = 1 To Len(a(i))
m = m + 1
b(m) = Mid(a(i), j, 1)
Next
End If
Next
If m > 0 Then
n = FreeFile
ReDim Preserve b(1 To m)
Open pth & "efg.txt" For Output As #n
Print #n, Join(b, vbNewLine)
Close n
End If
End Sub