如何用vb 将txt文件中 每四行变为一行
怎样将图一变为图二
Private Sub Form_Load() Dim data As String, buffer As String, Split As String Dim n As Long n = 0 Split = "," '你想要的分割符 Open "C:\Users\Admin\Desktop\1.txt" For Input As #1 Do While Not EOF(1) n = n + 1 Line Input #1, buffer If n Mod 4 = 0 Then data = data + buffer + vbCrLf Else data = data + buffer + Split End If Loop If Right(data, 1) = Split Then data = Left(data, Len(data) - 1) '对结果进行优化处理 Debug.Print data Close #1 End Sub
[此贴子已经被作者于2022-5-15 08:47编辑过]