Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Dealing with Large Amounts of Data in Files

Dealing with Large Amounts of Data in Files

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabasecareer
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jenleonard
    wrote on last edited by
    #1

    I am currently debugging a program that stores large amounts of data. Every 15 minutes 1000 pieces of data are calculated and written to a text file. This file is now 250 MB and getting very difficult to deal with. It crashes when opening, things crash when it is loaded, etc. Overall it was not written well. My job is to fix it, but I am not sure where to start. My coworkers have suggested splitting the file up so that every month a new file is generated, and only the last years worth of files are loaded, unless the user needs more. Another suggestion was using a binary file instead of text. Another suggestion was to convert the text file to a database. Someone thought that Access might not be able to handle a record with 1000 pieces of data. I have a lot of research to do, but I thought that this might help me in the right direction!! Any ideas you have would be greatly appreciated. Jennifer

    R M S 3 Replies Last reply
    0
    • J Jenleonard

      I am currently debugging a program that stores large amounts of data. Every 15 minutes 1000 pieces of data are calculated and written to a text file. This file is now 250 MB and getting very difficult to deal with. It crashes when opening, things crash when it is loaded, etc. Overall it was not written well. My job is to fix it, but I am not sure where to start. My coworkers have suggested splitting the file up so that every month a new file is generated, and only the last years worth of files are loaded, unless the user needs more. Another suggestion was using a binary file instead of text. Another suggestion was to convert the text file to a database. Someone thought that Access might not be able to handle a record with 1000 pieces of data. I have a lot of research to do, but I thought that this might help me in the right direction!! Any ideas you have would be greatly appreciated. Jennifer

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      If you choose to use a binary file (recommended, imho) you may want to see this[^] series of articles. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      1 Reply Last reply
      0
      • J Jenleonard

        I am currently debugging a program that stores large amounts of data. Every 15 minutes 1000 pieces of data are calculated and written to a text file. This file is now 250 MB and getting very difficult to deal with. It crashes when opening, things crash when it is loaded, etc. Overall it was not written well. My job is to fix it, but I am not sure where to start. My coworkers have suggested splitting the file up so that every month a new file is generated, and only the last years worth of files are loaded, unless the user needs more. Another suggestion was using a binary file instead of text. Another suggestion was to convert the text file to a database. Someone thought that Access might not be able to handle a record with 1000 pieces of data. I have a lot of research to do, but I thought that this might help me in the right direction!! Any ideas you have would be greatly appreciated. Jennifer

        M Offline
        M Offline
        Mohammad A Gdeisat
        wrote on last edited by
        #3

        Well, if you dont want to read the whole file, you dont need to load the whole file. That is, when first loading the file, load text from the file that fills only one page of your textbox, when the user moves the scroll bars of the textbox, you should determine where to go in the text file, load text that lie in that position and display it to the user. The user does not care whether the whole text file is loaded or not, but when loading the text from the file only-as-needed, you can gain a very good performance instead of loading the whole text file. You can load a 2GB text file in milliseconds with little memory usage, little cpu processing, and (almost) no disk load. Regards, Mohammad Gdeisat أعلنت إستسلام قلبي لرحيلك..دعه يودع خطوات سيرك..فقط إجعل قلبك يحتضن حروفي ويشعرها بدفئه فقد مللت كل لحظا تي بدونك....فمابقي لي إلا أن أثني على قسوتك.... فليتك تعلم كم أنهكتني...وكم أحرقتني...وكم جعلت مني وطنا بلا معالم. فـــدعنــي أبـــكي على شواطئ دفئك...قاتلي

        T 1 Reply Last reply
        0
        • M Mohammad A Gdeisat

          Well, if you dont want to read the whole file, you dont need to load the whole file. That is, when first loading the file, load text from the file that fills only one page of your textbox, when the user moves the scroll bars of the textbox, you should determine where to go in the text file, load text that lie in that position and display it to the user. The user does not care whether the whole text file is loaded or not, but when loading the text from the file only-as-needed, you can gain a very good performance instead of loading the whole text file. You can load a 2GB text file in milliseconds with little memory usage, little cpu processing, and (almost) no disk load. Regards, Mohammad Gdeisat أعلنت إستسلام قلبي لرحيلك..دعه يودع خطوات سيرك..فقط إجعل قلبك يحتضن حروفي ويشعرها بدفئه فقد مللت كل لحظا تي بدونك....فمابقي لي إلا أن أثني على قسوتك.... فليتك تعلم كم أنهكتني...وكم أحرقتني...وكم جعلت مني وطنا بلا معالم. فـــدعنــي أبـــكي على شواطئ دفئك...قاتلي

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          Mohammad A Gdeisat wrote: أعلنت إستسلام قلبي لرحيلك..دعه يودع خطوات سيرك..فقط إجعل قلبك يحتضن حروفي ويشعرها بدفئه فقد مللت كل لحظا تي بدونك....فمابقي لي إلا أن أثني على قسوتك.... فليتك تعلم كم أنهكتني...وكم أحرقتني...وكم جعلت مني وطنا بلا معالم. فـــدعنــي أبـــكي على شواطئ دفئك...قاتلي Could you please translate that in english...

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV

          M 1 Reply Last reply
          0
          • J Jenleonard

            I am currently debugging a program that stores large amounts of data. Every 15 minutes 1000 pieces of data are calculated and written to a text file. This file is now 250 MB and getting very difficult to deal with. It crashes when opening, things crash when it is loaded, etc. Overall it was not written well. My job is to fix it, but I am not sure where to start. My coworkers have suggested splitting the file up so that every month a new file is generated, and only the last years worth of files are loaded, unless the user needs more. Another suggestion was using a binary file instead of text. Another suggestion was to convert the text file to a database. Someone thought that Access might not be able to handle a record with 1000 pieces of data. I have a lot of research to do, but I thought that this might help me in the right direction!! Any ideas you have would be greatly appreciated. Jennifer

            S Offline
            S Offline
            S Douglas
            wrote on last edited by
            #5

            Jenleonard wrote:

            Another suggestion was to convert the text file to a database. Someone thought that Access might not be able to handle a record with 1000 pieces of data.

            As memory serves Access is good till about a gig in physical size. I have a few hundred thousand entries in an access database, and it runs without a problem. It all depends on the design. Using access to start out with gives you a good reference point to scale it to a SQL server.


            DEBUGGING : Removing the needles from the haystack.

            1 Reply Last reply
            0
            • T ThatsAlok

              Mohammad A Gdeisat wrote: أعلنت إستسلام قلبي لرحيلك..دعه يودع خطوات سيرك..فقط إجعل قلبك يحتضن حروفي ويشعرها بدفئه فقد مللت كل لحظا تي بدونك....فمابقي لي إلا أن أثني على قسوتك.... فليتك تعلم كم أنهكتني...وكم أحرقتني...وكم جعلت مني وطنا بلا معالم. فـــدعنــي أبـــكي على شواطئ دفئك...قاتلي Could you please translate that in english...

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta VC Forum Q&A :- I/ IV

              M Offline
              M Offline
              Mohammad A Gdeisat
              wrote on last edited by
              #6

              I am sorry, my signature is in arabic, and it has nothing with the answer, I hope that my answer to the post was submitted correctly, here what I wrote: Well, if you dont want to read the whole file, you dont need to load the whole file. That is, when first loading the file, load text from the file that fills only one page of your textbox, when the user moves the scroll bars of the textbox, you should determine where to go in the text file, load text that lie in that position and display it to the user. The user does not care whether the whole text file is loaded or not, but when loading the text from the file only-as-needed, you can gain a very good performance instead of loading the whole text file. You can load a 2GB text file in milliseconds with little memory usage, little cpu processing, and (almost) no disk load. Regards, Mohammad Gdeisat

              T 1 Reply Last reply
              0
              • M Mohammad A Gdeisat

                I am sorry, my signature is in arabic, and it has nothing with the answer, I hope that my answer to the post was submitted correctly, here what I wrote: Well, if you dont want to read the whole file, you dont need to load the whole file. That is, when first loading the file, load text from the file that fills only one page of your textbox, when the user moves the scroll bars of the textbox, you should determine where to go in the text file, load text that lie in that position and display it to the user. The user does not care whether the whole text file is loaded or not, but when loading the text from the file only-as-needed, you can gain a very good performance instead of loading the whole text file. You can load a 2GB text file in milliseconds with little memory usage, little cpu processing, and (almost) no disk load. Regards, Mohammad Gdeisat

                T Offline
                T Offline
                ThatsAlok
                wrote on last edited by
                #7

                Mohammad A Gdeisat wrote:

                my signature is in arabic, and it has nothing with the answer

                ohh you taking me wrong.. I just want to know what exactly your signature meant.

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                cheers, Alok Gupta VC Forum Q&A :- I/ IV

                M 1 Reply Last reply
                0
                • T ThatsAlok

                  Mohammad A Gdeisat wrote:

                  my signature is in arabic, and it has nothing with the answer

                  ohh you taking me wrong.. I just want to know what exactly your signature meant.

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                  cheers, Alok Gupta VC Forum Q&A :- I/ IV

                  M Offline
                  M Offline
                  Mohammad A Gdeisat
                  wrote on last edited by
                  #8

                  This is the translation of the signature: "My heart has surrendered for your leaving... let it say goodbye for your steps... just let your heart take my words and feel its warmness... because I've bored all my moments without you... there is nothing left except to praise your cruelty. I wish you know, how much you've to exhausted and burnt me, and how much you made me a building without a basis... so let me cry on the shores of your warmness...my killer" Its some kind of romantic sayings in arabic, to express feelings of a loving person... maybe my translation did not give the whole meaning, but it gives the idea. Even programmers can fall in love! And ever has it been that love knows not its own depth until the hour of separation

                  T 1 Reply Last reply
                  0
                  • M Mohammad A Gdeisat

                    This is the translation of the signature: "My heart has surrendered for your leaving... let it say goodbye for your steps... just let your heart take my words and feel its warmness... because I've bored all my moments without you... there is nothing left except to praise your cruelty. I wish you know, how much you've to exhausted and burnt me, and how much you made me a building without a basis... so let me cry on the shores of your warmness...my killer" Its some kind of romantic sayings in arabic, to express feelings of a loving person... maybe my translation did not give the whole meaning, but it gives the idea. Even programmers can fall in love! And ever has it been that love knows not its own depth until the hour of separation

                    T Offline
                    T Offline
                    ThatsAlok
                    wrote on last edited by
                    #9

                    thats nice :)

                    "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                    cheers, Alok Gupta VC Forum Q&A :- I/ IV

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups