'Imports System.IO Dim srcPath As String = "C:\TEST\TEXTHOGE.txt" Dim dstFolder As String = Path.GetDirectoryName(srcPath) Dim dstFile As String = Path.GetFileNameWithoutExtension(srcPath) & "2" & Path.GetExtension(srcPath) 'Dim dstPath As String = "C:\TEST\TEXTHOGE2.txt" Dim dstPath As String = Path.Combine(dstFolder, dstFile) Dim enc = System.Text.Encoding.GetEncoding("Shift_JIS") Dim oldText As String = File.ReadAllText(srcPath, enc) Dim newText As String = oldText.Replace(" ", "") File.WriteAllText(dstPath, newText, enc)