Thank alot mate. Now i need to add a number to each line.
why thos code will not add a number to each line from text file ?
VB.NET:
If File.Exists("C:\adresa.txt") Then
Dim file1Sr As New StreamReader("C:\adresa.txt")
Dim theLineNumber As Integer = 1
Dim aLine As String
Dim fileSw As StreamWriter
fileSw = File.AppendText("C:\adresa.txt")
While file1Sr.Peek() <> -1
aLine = file1Sr.ReadLine
If aLine.Length >= 0 Then
fileSw.WriteLine(theLineNumber.ToString& " - " & aLine)
theLineNumber += 1
End If
End While
file1Sr.Close()
fileSw.Close()
End If
Last edited: