something similar to this will do what you want.......
Public Sub SeekAPerson(ByVal index As Integer)
Try
FileOpen(1, "c:people.txt", OpenMode.Random)
Dim onePerson As Record
Seek(1, index)
FileGet(1, onePerson)
FileClose(1)
Console.WriteLine(onePerson.Name & " " & onePerson.ID)
Catch
' Error recovery code here.
End Try
End Sub
testblokepuma < k-addie%40keihin-europe.co.uk">k-addie
keihin-europe.co.uk> wrote: Good morning,
I was wondering the most efficient way to delete a line from a text
file.
I know the line number that I need to delete. I am currently opening
the file, reading the entire file into an array, (split by vbCrLf),
then write the file back to a file less the one line I wish to remove.
AS the textfiles can have 2000+ lines, I thought this was a bit
inneficient and there must be a better way ?
I would appreciate your comments
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
[Non-text portions of this message have been removed]
.