Here's one way of approaching your problem (pseduo-code):
while !eof {
increment fileline
while (stillgoing) {
increment index
read line fileline from file
if (compare string to one in database = FALSE)
stillgoing = FALSE
if (index > 5)
insert lines in file
} end while
} end while
Just off the top of my head. Don't take it too literally.
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
Offline 5,055 posts
since Apr 2006