hi i need to know how to delete records from a flat file without emptying the whole thing anyone no how?????? thanks will be appreciated
parkes92
0
Newbie Poster
Recommended Answers
Jump to Postthat depends entirely on how the data is stored in the flat file... the problem with flatfiles, is that they are sequential. So, at the very least, you are going to have to loop through the lines in the file, until you find your record, remove your record, and re-write …
Jump to Postright now, yes. But remove a record..... then what? There will be a blank line. Now you will have to somehow shift ALL LINES to cover down for the blank.
Jump to PostWell, how does it look in the database file? That is, what is the format of the fields?
firstname:lastname:date:phone firstname:lastname:date:phone firstname:lastname:date:phone
or something more like:
id, firstname, lastname, date, phone
?
All 10 Replies
Comatose
290
Taboo Programmer
Team Colleague
parkes92
0
Newbie Poster
Comatose
290
Taboo Programmer
Team Colleague
parkes92
0
Newbie Poster
parkes92
0
Newbie Poster
Comatose
290
Taboo Programmer
Team Colleague
parkes92
0
Newbie Poster
hkdani
39
Posting Pro in Training
parkes92
0
Newbie Poster
hkdani
39
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.