Results 1 to 2 of 2

Thread: very big files

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member zak's Avatar
    Join Date
    Dec 2008
    Posts
    637
    Rep Power
    83

    very big files

    i read about this before years, but remembered it when i have compressed the 2MB pi.txt in this thread, it is compressed to about half, because pi digits somewhat random and can't be represented in a more concise form.
    so i have tried the attached code to make a 51 MB file with just zero's and newlines, when we compress it its new size will be about 55 KB, and you can reduce the compressed file size more by removing the newlines.
    do not try to open the resulted text files since it will hang your editor.

    if we can describe something big then it can be compressed efficiently

    Uses "file","console"
    Dim st,s As String
    Dim i As Long
    PrintL "wait........." 
    s = "0000000000000000000000000000000000000000000000000000" + Chr$(13) + Chr$(10)
     
    For i=1 To 10000
    st=st + s
    Next
    'FILE_Save(APP_SourcePath +"big.txt",st)
    For i=1 To 100
    FILE_Append(APP_SourcePath +"bigFile.txt",st)
    Next
    PrintL "finish"
    WaitKey
    
    Last edited by zak; 22-04-2011 at 17:40.

Similar Threads

  1. help files
    By newguy1 in forum Shout Box Area
    Replies: 5
    Last Post: 29-03-2006, 11:26

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •