C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 10th, 2004, 11:15 PM
aquarius aquarius is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Vancouver + Hong Kong
Posts: 1 aquarius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Possible to remove the line from txt file right after reading it?

Hi,

I'm trying to build a program that sort out informations from a ver large txt file, and i'm basically doing something like this:

Code:
 
ifstream x;
ofstream y;
string temp;
 
x.open ("file.txt", ios::in);
 
while (!x.eof())
{
		   getline (x, temp);
 
		   if ( x[1] == " xxxx ")
		   { 
				   y.open("sorted.txt", ios::app);
				   y >> temp >> endl;
				   y.close(); 
		   }
}
 

But after reading for around 1/4 of a 400mb txt file, the program just terminated before the end of file. I suspect that it's have to do with the file pointer.

So is there a way for me to delete the line from the file right after reading it?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Possible to remove the line from txt file right after reading it?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway