I have a .txt with this format:
I can remove the NUL characters in Notepad++ like this:
So I read about it, and I found the solution to replace the regular expresion "\x00" for " " ... but I need to create a VBScript. I found examples like this one:
sPath = "C:\Users\AL\T_1538_89945.txt"
sContent = ReadTextFile(sPath, 0) ' lFormat -2 - System default, -1 - Unicode, 0 - ASCII
sContent = Replace(sContent, "\x00", " ")
WriteTextFile sContent, sPath, 0
Function ReadTextFile(sPath, lFormat)
With CreateObject("Scripting.FileSystemObject").OpenTextFile(sPath, 1, False, lFormat)
ReadTextFile = ""
If Not .AtEndOfStream Then ReadTextFile = .ReadAll
.Close
End With
End Function
Sub WriteTextFile(sContent, sPath, lFormat)
With CreateObject("Scripting.FileSystemObject").OpenTextFile(sPath, 2, True, lFormat)
.Write sContent
.Close
End With
End Sub
But it doesn't work, can someone adapt the code so it can run it from that location cleaning those regular expressions?