Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / December 2006

Tip: Looking for answers? Try searching our database.

File Stream problem ....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lavu - 07 Dec 2006 14:53 GMT
I am trying to use filestreams (ifstream / ofstream) to copy
a text file line by line except except the last few lines that meet
certain conditions.
Each line is of variable length.
With the line length unknown, I used a fixed byte length  buffer of 255
characters that I
copy over using getline(). However this removes the newline at the end
of the line and copies over
whatever value I have intialized the receving buffer.

what would be a clean way to copy over a line including a newline from
one file to another ?
Any help is appreciated.
Ben Voigt - 07 Dec 2006 20:27 GMT
>I am trying to use filestreams (ifstream / ofstream) to copy
> a text file line by line except except the last few lines that meet
[quoted text clipped - 9 lines]
> one file to another ?
> Any help is appreciated.

To be perfectly honest, a scripting language such as Perl would be a much
better choice for this task.  The whole program would be about five lines.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.