extract from file

S

steganos

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

osmium

steganos said:
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.
 
J

Jim Langston

steganos said:
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.
 
R

rossum

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
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top