Hello. Try this code
Sub Test()
Dim x As Variant
Dim sFolder As String
Dim sFile As String
Dim sTxt As String
Dim nStr As String
Dim f As Integer
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show Then sFolder = .SelectedItems(1) & "\" Else Exit Sub
End With
sFile = Dir(sFolder & "*.txt")
Do While sFile <> ""
f = FreeFile
Open sFolder & sFile For Input As #f
sTxt = Input(LOF(f), f)
Close #f
x = Split(sTxt, vbCrLf)
nStr = "," & Split(x(0), ",")(UBound(Split(x(0), ",")))
x(0) = Replace(x(0), nStr, "")
sTxt = Join(x, vbCrLf)
f = FreeFile
Open sFolder & sFile For Output As #f
Print #f, sTxt
Close #f
sFile = Dir
Loop
End Sub
Bookmarks