Salve ragazzi
Allora
ho un file di ingresso ed ho il tracciato dovrei però non contare gli spazi ma solo i caratteri
ho buttato giù un po di codice ma non riesco a contare solo i caratteri chi mi può aiutare????
questo è il codice
graziecodice:Sub Main() Dim FileDaAprire As String = "C:\tmp\PPTRCG.D" 'path dove si trova il file 'Dim FileDaAprire As String() = Command().Split(" ") Dim Righe As String() = File.ReadAllLines(FileDaAprire) Dim FileDaScrivere As StreamWriter = New StreamWriter("C:\tmp\filecreato.txt", False) 'path file di input For Each Riga In Righe 'campi da leggere. la lettura parte da 0 e non da 1 Dim CodContt As String = Riga.Substring(0, 1) Dim CodDit As String = Riga.Substring(1, 6) Dim CodAttv As String = Riga.Substring(7, 2) Dim CodCenDiCosCont As String = Riga.Substring(9, 21) Dim AAPerdElabn As String = Riga.Substring(21, 25) Dim MMPerdElabn As String = Riga.Substring(25, 26) FileDaScrivere.WriteLine(CodContt + ";" + CodDit + ";" + CodAttv + ";" + CodCenDiCosCont + ";" + AAPerdElabn + ";" + MMPerdElabn) Next Riga FileDaScrivere.Flush() FileDaScrivere.Close() End Sub

Rispondi quotando