Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSpreadsheet writing Pin
Ger Hayden9-Feb-04 21:58
Ger Hayden9-Feb-04 21:58 
GeneralRe: Spreadsheet writing Pin
Brian D10-Feb-04 1:46
Brian D10-Feb-04 1:46 
GeneralRe: Spreadsheet writing Pin
David Crow10-Feb-04 3:34
David Crow10-Feb-04 3:34 
GeneralListCtrl Pin
Ger Hayden9-Feb-04 21:57
Ger Hayden9-Feb-04 21:57 
GeneralRe: ListCtrl Pin
David Crow10-Feb-04 3:33
David Crow10-Feb-04 3:33 
GeneralCInternetSession and CHttpConnection. Pin
murali_utr9-Feb-04 20:59
murali_utr9-Feb-04 20:59 
GeneralOverwriting / Deleting of data from file Pin
Kel839-Feb-04 20:42
Kel839-Feb-04 20:42 
GeneralRe: Overwriting / Deleting of data from file Pin
Sebastian Schneider9-Feb-04 22:31
Sebastian Schneider9-Feb-04 22:31 
Well, file manipulation is buffer manipulation.

You will have to rewrite the file. Any editor does it that way: load the file, manipulate it, write it to disk again. Some editors (saving physical memory) write to a temporary file first, delete the old and rename the new file.

As I am not that familiar with (V)C++, I would suggest
fgets to retrieve the lines. Then store them in a linked list and manipulate that list until it meets your requirements. Then write it back to disk.

Open file (read-only)
begin loop
Read line from file
store line (linked list, dynamic array... whatever you can do)
loop until eof
close file

manipulate list

open file (same file, do not append data but overwrite instead)
begin loop
write line to file from list
delete line from list
loop until last element
close file

Thats what I would do Wink | ;)

Cheers
Sebastian
GeneralRe: Overwriting / Deleting of data from file Pin
Florin Vasilescu10-Feb-04 3:50
Florin Vasilescu10-Feb-04 3:50 
GeneralANSI C compliance Pin
ffazly9-Feb-04 19:55
ffazly9-Feb-04 19:55 
GeneralRe: ANSI C compliance Pin
Andrew Walker9-Feb-04 21:59
Andrew Walker9-Feb-04 21:59 
GeneralRe: ANSI C compliance Pin
Mike Dimmick10-Feb-04 1:04
Mike Dimmick10-Feb-04 1:04 
GeneralLinking dll's Pin
Badut9-Feb-04 19:25
Badut9-Feb-04 19:25 
GeneralRe: Linking dll's Pin
Michael Dunn9-Feb-04 19:47
sitebuilderMichael Dunn9-Feb-04 19:47 
GeneralXML Porting Problem Pin
Shenthil9-Feb-04 19:23
Shenthil9-Feb-04 19:23 
GeneralRe: XML Porting Problem Pin
Steve S9-Feb-04 22:19
Steve S9-Feb-04 22:19 
GeneralRe: XML Porting Problem Pin
Shenthil10-Feb-04 1:39
Shenthil10-Feb-04 1:39 
GeneralRe: XML Porting Problem Pin
Steve S10-Feb-04 2:37
Steve S10-Feb-04 2:37 
Questionhow to programme to encode CDA (CD audio track) to WMA? Pin
zhaopzhi9-Feb-04 18:44
zhaopzhi9-Feb-04 18:44 
AnswerRe: how to programme to encode CDA (CD audio track) to WMA? Pin
Michael Dunn9-Feb-04 19:45
sitebuilderMichael Dunn9-Feb-04 19:45 
GeneralRe: how to programme to encode CDA (CD audio track) to WMA? Pin
Sebastian Schneider9-Feb-04 22:37
Sebastian Schneider9-Feb-04 22:37 
GeneralAdobe Acrobat SDK- Pdf Conversion Pin
mohdshiraz9-Feb-04 18:06
mohdshiraz9-Feb-04 18:06 
GeneralRe: Adobe Acrobat SDK- Pdf Conversion Pin
David Crow10-Feb-04 3:36
David Crow10-Feb-04 3:36 
GeneralRe: Adobe Acrobat SDK- Pdf Conversion Pin
mohdshiraz10-Feb-04 17:40
mohdshiraz10-Feb-04 17:40 
GeneralRe: Adobe Acrobat SDK- Pdf Conversion Pin
David Crow11-Feb-04 2:52
David Crow11-Feb-04 2:52 

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.