|
|
Home » Community » Newbie corner » Problem loading very large data files (The system hangs up when loading data from large files.)
Problem loading very large data files [message #61445] |
Thu, 13 February 2025 22:45  |
DMStevenson
Messages: 6 Registered: January 2025 Location: Wisconsin
|
Promising Member |
|
|
I am still new, and am having problems loading data from very large files (>35MB) into Vectors. I know this works in other languages, and being new I might be missing something obvious. With smaller data files the load time into Vectors is quite fast, but with very large files the system hangs up, and will simply not proceed (no error message). Has anyone had any experience with this?
|
|
|
|
Re: Problem loading very large data files [message #61452 is a reply to message #61448] |
Fri, 14 February 2025 16:46   |
DMStevenson
Messages: 6 Registered: January 2025 Location: Wisconsin
|
Promising Member |
|
|
Thanks for the reply Koldo. As a Newbie I continue to learn quickly, and have found that, over time, my large files do load, but they simply do not appear in a DocEdit for a while. For the code below I expected the contents of a file to appear line-by-line. Instead it seems to completely fill a buffer and *then* is posted to the DocEdit. Am I correct in this? My aim is *NOT* to fill a DocEdit with a huge amount of text, but I was doing this just as a programming step... Thanks, DMStevenson
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct WindowType : TopWindow {
Button button;
String FileName;
DocEdit memo;
Progress progress1;
Vector<String> DataLines;
void ReadFile(String file_name) {
String line;
FileIn infile;
if (infile.Open(file_name)) {
while(!infile.IsEof()) {
line = infile.GetLine();
memo.Append(line);
memo.Append("\n");
DataLines.Add(line);
}
}
infile.Close();
}
WindowType()
{
Title("File Read");
button << [=] {
FileName = SelectFileOpen("All Files\t*.*");
ReadFile(FileName); };
button.SetLabel("Get File");
Add(button.LeftPos(10, 60).TopPos(10, 30));
Add(memo.LeftPos(10, 680).TopPos(50, 430));
}
};
GUI_APP_MAIN
{
WindowType app;
app.SetRect(0,0,700,500);
app.Run();
}
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Jun 13 23:01:14 CEST 2025
Total time taken to generate the page: 0.04266 seconds
|
|
|