codice:
Const ForReading = 1
Const ForWriting = 2
strFileName = "C:\Users\Desktop\export.xml"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "firstname", "Nome")
strNewText = Replace(strNewText, "lastname", "Cognome")
strNewText = Replace(strNewText, "validto", "Valido_fino_al")
strNewText = Replace(strNewText, "validfrom", "Valido_dal")
strNewText = Replace(strNewText, "persType", "Tipo_Dipendente")
strNewText = Replace(strNewText, "persStatus", "Stato")
strNewText = Replace(strNewText, "phoneNo", "Telefono")
strNewText = Replace(strNewText, "persUserid", "Codice_Fiscale")
strNewText = Replace(strNewText, "ACTIVE", "Attivo")
strNewText = Replace(strNewText, "NON_ACTIVE", "Non_Attivo")
strNewText = Replace(strNewText, "email", "E-mail")
strNewText = Replace(strNewText, "specialistArea", "Area_Specialistica")
strNewText = Replace(strNewText, "<?xml version=" & chr(34) & "1.0" & chr(34) & " encoding=" & chr(34) & "UTF-8" & chr(34) & "?>", "")
strNewText = Replace(strNewText, "<VMObjects exporter-version=" & chr(34) & "3.0.8" & chr(34) & "", "")
strNewText = Replace(strNewText, "modules=" & chr(34) & "0,1,2,4,6,7,9,99,101,333,500,702,704" & chr(34) & "", "")
strNewText = Replace(strNewText, "timezone=" & chr(34) & "Europe/Berlin" & chr(34) & " version=" & chr(34) & "3.6.1.HOTFIX17" & chr(34) & "", "")
strNewText = Replace(strNewText, "xmlns:xsi=" & chr(34) & "http://www.w3.org/2001/XMLSchema-instance" & chr(34) & "", "")
strNewText = Replace(strNewText, "xsi:noNamespaceSchemaLocation=" & chr(34) & "VMObjects.xsd" & chr(34) & ">", "<Persone>")
strNewText = Replace(strNewText, "</VMObjects>", "</Persone>")
strNewText = Replace(strNewText, "vip", "Vip")
Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.WriteLine strNewText
objFile.Close
Il problema è che non riesco a trovare niente di niente riguardante la lettura di una singola riga. In Java saprei come fare..Leggerei il file e inserirei le righe in un array, scambierei le posizioni con una variabile d'appoggio e fine.