Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to read a text file line by line and remove some line

Reply
Thread Tools

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

 
 
kaushikshome
Guest
Posts: n/a
 
      09-10-2006
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

 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      09-10-2006
"kaushikshome" writes:

> 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?


 
Reply With Quote
 
 
 
 
Jerry Coffin
Guest
Posts: n/a
 
      09-10-2006
In article < .com>,
says...
> 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.

--
Later,
Jerry.

The universe is a figment of its own imagination.
 
Reply With Quote
 
kaushikshome
Guest
Posts: n/a
 
      09-10-2006
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
osmium wrote:

> "kaushikshome" writes:
>
> > 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?


 
Reply With Quote
 
kaushikshome
Guest
Posts: n/a
 
      09-10-2006
Ok...let me analyse it and I shall get back to u soon..
thanks for replying..
regards,

Kaushik
Jerry Coffin wrote:

> In article < .com>,
> says...
> > 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.
>
> --
> Later,
> Jerry.
>
> The universe is a figment of its own imagination.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Read a file line by line and write each line to a file based on the5th byte scad C++ 23 05-17-2009 06:11 PM
Fast way to read a text file line by line Thomas Kowalski C++ 6 05-18-2007 07:54 AM
Read Text File and split them to individual text file Krish ASP .Net 1 10-20-2005 03:39 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57