dim tableau() as string dim a as string dim b as string Try tableau = System.IO.File.ReadAllLines("c:\bbb.txt) Catch ex As Exception MessageBox.Show(ex.Message) End Try après travaille avec tableau For Each Str As String In tableau If Str.Substring(0, 2) = "$D" Then a = str.Substring("$D".Length, str.IndexOf(".") - "$D".Length) b = str.Substring(str.IndexOf(".") + 1) End If Next
et remplacer le contenu apres le point (delimiteur)de la ligne suivante.
Dim tableau() As String Dim nouveautableau As New List(Of String) Dim a As String Dim b As String tableau = Nothing a = String.Empty b = String.Empty Try tableau = System.IO.File.ReadAllLines("e:\bbb.txt") Catch ex As Exception MessageBox.Show(ex.Message) End Try 'après travaille avec tableau For Each Str As String In tableau If Str.Substring(0, 2) = "$F" Then a = String.Empty b = String.Empty nouveautableau.Add(Str) Else If Str.Substring(0, 2) = "$D" Then a = Str.Substring("$D".Length, Str.IndexOf(".") - "$D".Length) b = Str.Substring(Str.IndexOf(".") + 1) Else nouveautableau.Add(Str.Replace(Str.Substring(Str.IndexOf(".") + 1), a & "." & b)) End If End If Next End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question