To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Other Languages > C and C++

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Jan 19th, 2007, 07:19 AM   #1
asenthil
Junior Member
 
Join Date: Jan 07
Posts: 27
asenthil is an unknown quantity at this point (<10)
How to read the contents of a doc file and write the contents into another doc file?

Hai to all,

i had tried to read the contents of a text file and write that contents into

another text file...

But when i used the same codings for reading the contents of a ms word doc file and writing it into another ms word doc file, itz not working...

Here the codings i had used...

Code:
#include <iostream>
#include <fstream>
#include <string>
#include <conio.h>

using namespace std;

void main () {
string line;
ifstream myfile ("C:/1.doc");
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
}

else cout << "Unable to open file"; 

ofstream myfile1;
myfile1.open ("C:/2.doc");
myfile1 << line;
myfile1.close();
getch();
}
what shall i do for doc files...

Can any one plzz explain me?

senthil.
asenthil is offline   Reply With Quote
Old Jan 19th, 2007, 07:35 AM   #2
penagate
Super Moderator
 
Join Date: Jan 05
Location: Sunny Adelaide
Posts: 12,532
penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)penagate has much to be proud of (1500+)
Re: How to read the contents of a doc file and write the contents into another doc fi

Files are files.

http://www.cplusplus.com/doc/tutorial/files.html

And indent your code, otherwise no-one will read it.
penagate is offline   Reply With Quote
Reply

Go Back   VBForums > Other Languages > C and C++


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump


All times are GMT -5. The time now is 02:23 PM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.