Writing to a specific line of a file.

Posted by helpmeh on Stack Overflow See other posts from Stack Overflow or by helpmeh
Published on 2010-04-23T08:24:22Z Indexed on 2010/04/23 8:43 UTC
Read the original article Hit count: 636

Filed under:
|

I have a .dat file with data like this in

"James","Project5","15/05/2010","3"
"Matt","Project1","01/05/2010","5"
"Ellie","Project5","24/04/2010","1"
"Ellie","Project2","10/05/2010","3"
"Matt","Project3","03/05/2010","4"

It gets written in with thise code.

Private Sub Command2_Click()
Open jobs For Append As #1
Write #1, Combo1, Combo3, Combo2, Text3
Close #1
End Sub

I instead would like to write it to the file so that if a persons name is already in the file then it would just put the data in the file, under their that is already there but without the name. I can't figure out how to do this but this is what I would like it to end up like.

"James","Project5","15/05/2010","3"
"Matt","Project1","01/05/2010","5"
"Ellie","Project5","24/04/2010","1"
"Project2","10/05/2010","3"
"Matt","Project3","03/05/2010","4"

Any help would be fantastic!

© Stack Overflow or respective owner

Related posts about vb6

Related posts about file