1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Dim str As String
Dim ID As Integer
Public Function Func(ByVal line As String) As String
Dim r As New RegularExpressions.Regex("BO_[\s][0-9]+[A-Za-z]", RegularExpressions.RegexOptions.Compiled)
Return r.Match(line).Groups(3).Value
End Function
Public Sub lecture(ByVal fichier As String)
Do
ligne = SR.ReadLine()
Loop Until (str = ligne.IndexOf("BO_"))
ID = Func(str)
''pos = ligne.IndexOf("BO_")
'ID = ligne.Substring(3, str + 5)
SR.Close()
SW.WriteLine(ID)
SW.Close()
End Sub |
Partager