Click here to Skip to main content
15,909,498 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File handaling problem Pin
Ric Ashton2-Mar-09 6:31
Ric Ashton2-Mar-09 6:31 
GeneralRe: File handaling problem Pin
Ric Ashton2-Mar-09 6:33
Ric Ashton2-Mar-09 6:33 
GeneralRe: File handaling problem Pin
Davitor2-Mar-09 6:45
Davitor2-Mar-09 6:45 
GeneralRe: File handaling problem Pin
Davitor2-Mar-09 6:42
Davitor2-Mar-09 6:42 
GeneralRe: File handaling problem Pin
Eytukan2-Mar-09 6:56
Eytukan2-Mar-09 6:56 
GeneralRe: File handaling problem Pin
Ric Ashton2-Mar-09 6:59
Ric Ashton2-Mar-09 6:59 
GeneralRe: File handaling problem Pin
Richard Andrew x642-Mar-09 7:44
professionalRichard Andrew x642-Mar-09 7:44 
AnswerRe: File handaling problem Pin
Maximilien2-Mar-09 6:53
Maximilien2-Mar-09 6:53 
1- create a structure (or class) that contains the fields for each record ; create/use a collection that holds your records
2- in a loop :
3- read one line of the file, knowing that you know the format, you can skip unwanted lines.
4- skip line if unwanted; if line contains (is?) "============" and it's the first one, then you know it's a
new record.
5- read the next few lines to fill a record.
6- look in your collection to see if new record is already there; if it's not there, add it to your collection.
7- once you've read all the lines,
8- write back the data line-by-line in a new file.

(steps 5,6 can be optimized to not have to create a new record until you've find if the item is not in the collection).

This signature was proudly tested on animals.

GeneralRe: File handaling problem Pin
Davitor2-Mar-09 7:05
Davitor2-Mar-09 7:05 
GeneralRe: File handaling problem Pin
Maximilien2-Mar-09 7:16
Maximilien2-Mar-09 7:16 
AnswerRe: File handaling problem Pin
David Crow2-Mar-09 9:01
David Crow2-Mar-09 9:01 
QuestionConstructor / Destructor Question Pin
Richard Andrew x642-Mar-09 5:15
professionalRichard Andrew x642-Mar-09 5:15 
AnswerRe: Constructor / Destructor Question Pin
«_Superman_»2-Mar-09 5:31
professional«_Superman_»2-Mar-09 5:31 
GeneralRe: Constructor / Destructor Question Pin
Richard Andrew x642-Mar-09 6:10
professionalRichard Andrew x642-Mar-09 6:10 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 6:42
Eytukan2-Mar-09 6:42 
GeneralRe: Constructor / Destructor Question Pin
Perisic, Aleksandar2-Mar-09 7:37
Perisic, Aleksandar2-Mar-09 7:37 
GeneralRe: Constructor / Destructor Question Pin
Richard Andrew x642-Mar-09 7:39
professionalRichard Andrew x642-Mar-09 7:39 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 19:34
Eytukan2-Mar-09 19:34 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 19:32
Eytukan2-Mar-09 19:32 
GeneralRe: Constructor / Destructor Question Pin
Perisic, Aleksandar2-Mar-09 19:54
Perisic, Aleksandar2-Mar-09 19:54 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 20:03
Eytukan2-Mar-09 20:03 
GeneralRe: Constructor / Destructor Question Pin
Richard Andrew x642-Mar-09 7:38
professionalRichard Andrew x642-Mar-09 7:38 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 19:46
Eytukan2-Mar-09 19:46 
AnswerRe: Constructor / Destructor Question Pin
Perisic, Aleksandar2-Mar-09 5:38
Perisic, Aleksandar2-Mar-09 5:38 
QuestionNeed help on CDateTimeCtrl class Pin
John5022-Mar-09 4:25
John5022-Mar-09 4:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.