Binary file to ASCII....

Discussion in 'C Programming' started by swetha, Nov 19, 2007.

  1. swetha

    swetha Guest

    HI Every1,
    I have a file in binary format. Using a C program i
    have to read that file and need to make some changes . So i wanted to
    convert that into ACII format.Can any1 suggest me how to do that
    please.....

    Thanks In Advance....
    Swetha..
     
    swetha, Nov 19, 2007
    #1
    1. Advertising

  2. swetha

    cr88192 Guest

    "swetha" <> wrote in message
    news:...
    > HI Every1,
    > I have a file in binary format. Using a C program i
    > have to read that file and need to make some changes . So i wanted to
    > convert that into ACII format.Can any1 suggest me how to do that
    > please.....
    >


    question is too vague...

    for example, do you want a hexdump?
    do you want to transfer binary payload in a textual container (base64)?
    do you want to decompose some binary format into a human readable form?
    ....


    > Thanks In Advance....
    > Swetha..
     
    cr88192, Nov 19, 2007
    #2
    1. Advertising

  3. swetha

    Ed Prochak Guest

    On Nov 18, 8:01 pm, swetha <> wrote:
    > HI Every1,
    > I have a file in binary format. Using a C program i
    > have to read that file and need to make some changes . So i wanted to
    > convert that into ACII format.Can any1 suggest me how to do that
    > please.....
    >
    > Thanks In Advance....
    > Swetha..



    I can make the change for you and send the result to your instructor.
    Just send me the email address of your instructor with the file.

    Ed
     
    Ed Prochak, Nov 19, 2007
    #3
  4. swetha

    cr88192 Guest

    "Ed Prochak" <> wrote in message
    news:...
    > On Nov 18, 8:01 pm, swetha <> wrote:
    >> HI Every1,
    >> I have a file in binary format. Using a C program i
    >> have to read that file and need to make some changes . So i wanted to
    >> convert that into ACII format.Can any1 suggest me how to do that
    >> please.....
    >>
    >> Thanks In Advance....
    >> Swetha..

    >
    >
    > I can make the change for you and send the result to your instructor.
    > Just send me the email address of your instructor with the file.
    >


    just wondering:
    what exactly in this convinces you it is a homework question?...
    I could not tell.

    to me it sounds more like a vague newb question...


    > Ed
     
    cr88192, Nov 19, 2007
    #4
  5. swetha

    osmium Guest

    "swetha" writes:

    > I have a file in binary format. Using a C program i
    > have to read that file and need to make some changes . So i wanted to
    > convert that into ACII format.Can any1 suggest me how to do that
    > please.....


    What if you were told to produce a hard copy (printed) version of the file,
    could you do that? That's pretty much what an ASCII file is, except it
    isn't printed or displayed on a monitor, the resultant output is put in,
    well, a file. .

    If you couldn't do that, why not? There must be some way, *known to you*,
    of representing each datum in the original binary file, no exceptions
    permitted.
     
    osmium, Nov 19, 2007
    #5
  6. swetha

    James Kuyper Guest

    swetha wrote:
    > HI Every1,
    > I have a file in binary format. Using a C program i
    > have to read that file and need to make some changes . So i wanted to
    > convert that into ACII format.Can any1 suggest me how to do that
    > please.....


    Binary isn't a format, it's a type of format; basically, the term can be
    applied to any file that contains data that isn't stored as text. You
    need to know the actual details of the file's binary format in order to
    write a program to convert it into ASCII. Find documentation of that
    format, and then someone can help you figure it out.
     
    James Kuyper, Nov 19, 2007
    #6
  7. swetha

    Sheth Raxit Guest

    On Nov 19, 6:01 am, swetha <> wrote:
    > HI Every1,
    > I have a file in binary format. Using a C program i
    > have to read that file and need to make some changes . So i wanted to
    > convert that into ACII format.Can any1 suggest me how to do that
    > please.....


    1. make your question clear.
    Binary file means ELF-etc file or binary data file.

    "You can read binary data file <if it was written using fwrite etc>
    using fread." <this may be the answer> <very simillar to you read
    ascii file>

    -Raxit
    >
    > Thanks In Advance....
    > Swetha..
     
    Sheth Raxit, Nov 19, 2007
    #7
  8. swetha

    santosh Guest

    In article
    <>,
    Sheth Raxit <> wrote on Monday 19 Nov 2007 5:54
    pm:

    > On Nov 19, 6:01 am, swetha <> wrote:
    >> HI Every1,
    >> I have a file in binary format. Using a C program
    >> i
    >> have to read that file and need to make some changes . So i wanted to
    >> convert that into ACII format.Can any1 suggest me how to do that
    >> please.....

    >
    > 1. make your question clear.
    > Binary file means ELF-etc file or binary data file.


    She made it reasonably clear in a later post that the file was a program
    data file consisting of structures.

    > "You can read binary data file <if it was written using fwrite etc>
    > using fread."


    What are you intending to convey by using angled brackets? Note that
    getc() and fgetc() can be used on non-text files too. However it's not
    as convenient as fread().

    > <this may be the answer> <very simillar to you read ascii file>


    What's up with all the angled brackets?
     
    santosh, Nov 19, 2007
    #8
    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. Marc Schellens
    Replies:
    8
    Views:
    3,039
    John Harrison
    Jul 15, 2003
  2. TOXiC
    Replies:
    5
    Views:
    1,283
    TOXiC
    Jan 31, 2007
  3. SandyMan
    Replies:
    6
    Views:
    879
    Jordan Abel
    May 3, 2006
  4. vim
    Replies:
    68
    Views:
    2,251
  5. James O'Brien
    Replies:
    3
    Views:
    269
    Ben Morrow
    Mar 5, 2004
Loading...

Share This Page