How to read a text file line by line and remove some line

How to read a text file line by line and remove some line

Post by kaushiksho » Tue, 12 Sep 2006 00:38:32


Can anyone please help me in writing the code in C++ :

I want a read a file line by line,remove the lines which have length of
a particular field in a line exceeding 63 characters After removing the
line the corresponding blank spaces generated after removal of the
line also needs to be removed.
.
I am in urgent need for this solution.Kindly help how to go about it.

Thanks in advance ,

Kaushik
 
 
 

How to read a text file line by line and remove some line

Post by osmiu » Tue, 12 Sep 2006 01:16:52

"kaushikshome" writes:


Where is your problem at? Can you open a file? read a line? write a line?

What is it you can't do?

 
 
 

How to read a text file line by line and remove some line

Post by Jerry Coff » Tue, 12 Sep 2006 02:07:03

In article < XXXX@XXXXX.COM >,
XXXX@XXXXX.COM says...

You can't delete data from the middle of the file, so you have to copy
data from the existing file to a new file, skipping over the parts you
don't want.

--
Later,
Jerry.

The universe is a figment of its own imagination.
 
 
 

How to read a text file line by line and remove some line

Post by kaushiksho » Tue, 12 Sep 2006 07:11:31

Boss I am new at C++ programming.....how can I open , read and write it
to a new file after ignoring certain lines..kindly tell me how to go
about it...(code)

Regards,

Kaushik
 
 
 

How to read a text file line by line and remove some line

Post by kaushiksho » Tue, 12 Sep 2006 07:12:55

Ok...let me analyse it and I shall get back to u soon..
thanks for replying..
regards,

Kaushik