Sub RemplacerCode()
Dim Source As String
Dim Destination As String
Dim nFile As Integer
Dim content As String
Dim segments() As String
Dim i As Long
Dim Hexa As String
Dim resultat As String
Source = "C:\Users\pc\Downloads\ISTAT_COMUNI\ISTAT_COMUNI.txt"
Destination = "C:\Users\pc\Downloads\ISTAT_COMUNI\ISTAT_COMUNI 2.txt"
nFile = FreeFile
Open Source For Input As #nFile
content = Input(LOF(nFile), #nFile)
Close #nFile
segments = Split(content, "\u00")
For i = 1 To UBound(segments)
Hexa = Left$(segments(i), 2) '
segments(i) = Chr$(Val("&H" & Hexa)) & Mid$(segments(i), 3)
Next
resultat = Join(segments, "")
nFile = FreeFile
Open Destination For Output As #nFile
Print #nFile, resultat;
Close #nFile
MsgBox "Finish"
End Sub
Last edited by anycoder; Jul 8th, 2026 at 08:17 AM.
Sub RemplacerCode()
Dim Source As String
Dim Destination As String
Dim nFile As Integer
Dim content As String
Dim segments() As String
Dim i As Long
Dim Hexa As String
Dim resultat As String
Source = "C:\Users\pc\Downloads\ISTAT_COMUNI\ISTAT_COMUNI.txt"
Destination = "C:\Users\pc\Downloads\ISTAT_COMUNI\ISTAT_COMUNI 2.txt"
nFile = FreeFile
Open Source For Input As #nFile
content = Input(LOF(nFile), #nFile)
Close #nFile
segments = Split(content, "\u00")
For i = 1 To UBound(segments)
Hexa = Left$(segments(i), 2) '
segments(i) = Chr$(Val("&H" & Hexa)) & Mid$(segments(i), 3)
Next
resultat = Join(segments, "")
nFile = FreeFile
Open Destination For Output As #nFile
Print #nFile, resultat;
Close #nFile
MsgBox "Finish"
End Sub
You may try vbman asynchronous download and convert json objects. You can use it freely. The compressed package contains the way to obtain vbman and more sample codes. It is open source and free.