Read/Split
Posted: Fri Jun 06, 2014 7:46 am
Hello,
can anyone give us a great sample for reading a file and split the all lines with a char?
so the files will has for example:
0|test|test
and we wanna split it to add them in separated textboxen
we have this but no idea how to use it with a file to read
so this must be used aswell.
anyone please?
can anyone give us a great sample for reading a file and split the all lines with a char?
so the files will has for example:
0|test|test
and we wanna split it to add them in separated textboxen
we have this but no idea how to use it with a file to read
so this must be used aswell.
anyone please?
Code: Select all
thank youDim data As String = Nothing
Using reader As StreamReader = New StreamReader(ReadFile)
Do While Not reader.EndOfStream
data &= vbNewLine & reader.ReadLine
Loop
End Using
For Each codePart As String In data.Split("|")
If (codePart.Trim).Length > 0 Then
'here it will be all transfered to split them in text boxen
End If