The script was written obviously by me, but without all the trailing spaces as in posted code. It is written for large and huge files where counting the lines must be enabled in configuration.
I restored 32-bit UltraEdit v26.10.0.72 from my archives. Then I created beginning from a small file which just 78,122 bytes opened with creation of a temporary file a large file with 680,808, 588 bytes by coping the small file contents and pasting it again and again and again. The large file has had finally 12,033,718 lines. There was several times displayed the message
Cannot allocate ... (don't remember anymore the exact message text) while creating the large file with using a temporary file. Then I exited UltraEdit.
I started UltraEdit again, opened again the now large file named VHBC_17-19.txt, this time without the usage of a temporary file, and run the script. It created the files VHBC_17-19_1.txt to VHBC_17-19_121.txt without showing any error message during script execution. The files created by the script had a file size between 5,519 KB and 5,530 KB. The first 120 files had exactly 100,000 lines as defined in the script. So I am unable to reproduce the issue.
It is really odd that the sizes of the created files are in your case mainly 0 KB, one has 91,985 KB, another one 92,463 and the last one 10,421 KB. The lines must be really long when 100,000 lines produce two files with about 89 MB. It would be perhaps a good idea on so long lines to reduce the value of
nLinesPerFile to
20000 to reduce the memory required as one block to copy the lines via a user clipboard from the large file into all the new files.
The only other idea I have is to insert below
Code: Select all
// Paste the file copied block into the new file.
UltraEdit.activeDocument.paste();
additionally the line
That line explicitly clears the clipboard after the paste to free memory. It should not make a difference, but who knows which other processes are running on your Dell 3650 Tower which also require memory at the same time like an anti-virus application immediately scanning the file just created by UltraEdit during the script execution.
PS: I wanted to see the message
Cannot allocate ... and therefore did again start with the same small file as before creating a large file with pasting 100,000 lines at end of the file again and again. But this time no message was displayed by UltraEdit v26.10.0.72. I have the impression that background processes had caused the messages on first creation of the large file as that was done short after starting Windows on which Windows starts usually several tasks in background. The second creation of a large file was more than 30 minutes later.