Raised This Month: $ Target: $400
 0% 

Remove a line in a file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 01-06-2007 , 18:51   Re: Remove a line in a file
Reply With Quote #4

Quote:
Originally Posted by MaximusBrood View Post
The real content of your text file is this:

test1\ntest2\ntest3\ntest4

If you want to remove the test3 line, remove test3\n
Show your crashing code please.
Something like
Code:
new file = fopen(filename,"wt+") new text[64], text_to_find[] = "lololol" while(!feof(file)) {     fgets(file, text, 63)     if(contain(text, text_to_find) != -1)     {         fprintf(file, " ")         break     } } fclose(file)
This isn't exacly the crash code, but it's the same way.

Last edited by Deviance; 01-07-2007 at 07:44.
Deviance is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode