help on reducing file size while having a readable format

Discussion in 'C Programming' started by pedro.ballester@gmail.com, Nov 30, 2006.

  1. Guest

    Hi everyone,

    One of my C programs produces a huge ascii file containing float,
    integers and characteres with a given structure. The file is 6.5GB
    which can be reduced to 569MB once zipped. The latter led me to think
    that there might be a way to achieve significant size reduction, while
    having file that can be read using C.

    So, do you know any way to write the file so as to get a similar size
    reduction while being able to read its contents? I have already tried
    to open a binary file for writing, but there is not much change.

    Thanks in advance,

    Pedro
     
    , Nov 30, 2006
    #1
    1. Advertising

  2. Tom St Denis Guest

    wrote:
    > Hi everyone,
    >
    > One of my C programs produces a huge ascii file containing float,
    > integers and characteres with a given structure. The file is 6.5GB
    > which can be reduced to 569MB once zipped. The latter led me to think
    > that there might be a way to achieve significant size reduction, while
    > having file that can be read using C.


    libz from gzip supports formatted input/output from gzip streams.

    [off topic in clc though...]

    Head to gzip.org and look at their API.

    Tom
     
    Tom St Denis, Nov 30, 2006
    #2
    1. Advertising

  3. santosh Guest

    wrote:
    > Hi everyone,
    >
    > One of my C programs produces a huge ascii file containing float,
    > integers and characteres with a given structure. The file is 6.5GB
    > which can be reduced to 569MB once zipped. The latter led me to think
    > that there might be a way to achieve significant size reduction, while
    > having file that can be read using C.
    >
    > So, do you know any way to write the file so as to get a similar size
    > reduction while being able to read its contents? I have already tried
    > to open a binary file for writing, but there is not much change.


    You probably need to link to a compression library and inflate and
    deflate the file "on-the-fly". Such details are off-topic here, but you
    might try zlib.
     
    santosh, Nov 30, 2006
    #3
    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. Andoni
    Replies:
    4
    Views:
    837
    Andoni
    Jul 21, 2005
  2. Dan Shelby
    Replies:
    7
    Views:
    549
    Dan Shelby
    Jan 26, 2005
  3. Martin

    Techniques for reducing code size?

    Martin, Aug 25, 2004, in forum: C Programming
    Replies:
    2
    Views:
    419
    Thomas Matthews
    Aug 25, 2004
  4. Chris Thomasson
    Replies:
    11
    Views:
    543
    Jerry Coffin
    Apr 23, 2007
  5. Replies:
    0
    Views:
    361
Loading...

Share This Page