By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,437 Members | 1,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,437 IT Pros & Developers. It's quick & easy.

extract from file

P: n/a
hi to all.... I have a problem. I know few the c but I need a program
to extract from a file .doc all the characters A (for example) and to
memorize them in a file counting them....

Jan 2 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"steganos" writes:
hi to all.... I have a problem. I know few the c but I need a program
to extract from a file .doc all the characters A (for example) and to
memorize them in a file counting them....
Step 1. Find out what .doc means by using this link

http://www.wotsit.org/search.asp?s=text

Convert the format into something useful such as ASCII text.

Step 2. Look for the desired characters and count them.
Jan 2 '07 #2

P: n/a
"steganos" <ga************@gmail.comwrote in message
news:11**********************@k21g2000cwa.googlegr oups.com...
hi to all.... I have a problem. I know few the c but I need a program
to extract from a file .doc all the characters A (for example) and to
memorize them in a file counting them....
I would suggest you look at OpenOffice. It is an opensource project. Maybe
it will have something you can use, and even if it doesn't you have the
source code. I would think, however, that if you STFW you should find some
freeware tool to convert a .doc file to pure text.

I'm not really sure of what you are trying to do, so it's hard to give you
pointers in how to do it.
Jan 2 '07 #3

P: n/a
On 2 Jan 2007 05:28:50 -0800, "steganos" <ga************@gmail.com>
wrote:
>hi to all.... I have a problem. I know few the c but I need a program
to extract from a file .doc all the characters A (for example) and to
memorize them in a file counting them....
A .doc file will be in a specific Microsoft format. For what you
appear to want to do, you should probably use a text file. Load the
document into MS Word and save it as a text file (.txt), it should
appear as one of the options in the "Save as type" drop down menu.

Once you have your text file then you will need to write a C++ program
to read the file, counting 'a's and save the result to another file.

Start by creating a small test text file "a1a2a3a4a5a6a7a8a9a0" with
ten 'a's in it. Then write you program and check that it correctly
counts the 'a's in your test file. When that works you can try larger
test files and eventually the actual .doc file (converted to text).

rossum

Jan 3 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.