Signo.X
Well-known member
hello all,
im trying to read a text file , which has a data similar to the following :
1. the line contains 2 values seperated by a comma ","
2.the value befor the comma is numeric
3. the value after the comma should have at least 1 numeric value.
thats what i have so far..
i was trying to use the method split..but i still cant get what i need to do.
can you please help me asap, as im new to vb.net ...
thanks in advance
im trying to read a text file , which has a data similar to the following :
i need to check that for every line it has 3 things :123,c1p01
.
.
.
1. the line contains 2 values seperated by a comma ","
2.the value befor the comma is numeric
3. the value after the comma should have at least 1 numeric value.
thats what i have so far..
VB.NET:
Dim strDir AsString = "C:\temp\test.txt"
Dim s AsString
Try
Dim sr AsNew System.IO.StreamReader(strDir)
DoUntil sr.Peek < 0
s = sr.ReadLine
If (s.Contains(",")) Then [COLOR=darkgreen]' check if the line contains a comma[/COLOR]
Console.WriteLine(s)
EndIf
Loop
sr.Close()
Catch ex As Exception
Console.WriteLine(ex.Message)
EndTry
EndSub
can you please help me asap, as im new to vb.net ...
thanks in advance
Last edited by a moderator: