extract from file

Discussion in 'C++' started by steganos, Jan 2, 2007.

  1. steganos

    steganos Guest

    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....
     
    steganos, Jan 2, 2007
    #1
    1. Advertising

  2. steganos

    osmium Guest

    "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.
     
    osmium, Jan 2, 2007
    #2
    1. Advertising

  3. steganos

    Jim Langston Guest

    "steganos" <> wrote in message
    news:...
    > 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.
     
    Jim Langston, Jan 2, 2007
    #3
  4. steganos

    rossum Guest

    On 2 Jan 2007 05:28:50 -0800, "steganos" <>
    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
     
    rossum, Jan 3, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Duke of Hazard
    Replies:
    0
    Views:
    768
    Duke of Hazard
    Jan 23, 2004
  2. =?Utf-8?B?QW5keQ==?=

    Showing an extract of XML file in a datagrid

    =?Utf-8?B?QW5keQ==?=, May 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    295
    =?Utf-8?B?QW5keQ==?=
    May 19, 2004
  3. SunRise
    Replies:
    2
    Views:
    653
    SunRise
    Jul 3, 2005
  4. SunRise
    Replies:
    7
    Views:
    749
    S.Tobias
    Jul 6, 2005
  5. Rider
    Replies:
    8
    Views:
    107
Loading...

Share This Page