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

K

kaushikshome

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
 
O

osmium

kaushikshome said:
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.

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

What is it you can't do?
 
J

Jerry Coffin

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.

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.
 
K

kaushikshome

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,
 
K

kaushikshome

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

Kaushik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top