Hi,
I'm trying to figure out how to efficiently remove hudreds of thousands of lines from a large text file. So e.g., one of the text files has about 3,082,488 lines, and is close a gig in size.
So, for testing purposes, we want to pair down several of these files, and maybe remove about 75% of the bottom lines. Or the top lines ; it doesn't matter which lines get removed.
This differs from most of the questions on the web, about removing lines from text files. Most of those questions involve filtering out text files by the existence of a specific string. These lines can be removed, regardless of their content.
It doesn't actually have to be done, in VBScript. It could be a Windows batch file. But not PowerShell.
There's some sample VBScript code here, from the people who publish my VBScript IDE:
I haven't tried this yet, but it seems to open the entire file in memory. I'm not certain how much that will slow down the system, or use up whatever virtual memory we have available.
Does this script look ok? Or is there a better VBScript or Windows Shell method of shortening a text file?
I'm trying to figure out how to efficiently remove hudreds of thousands of lines from a large text file. So e.g., one of the text files has about 3,082,488 lines, and is close a gig in size.
So, for testing purposes, we want to pair down several of these files, and maybe remove about 75% of the bottom lines. Or the top lines ; it doesn't matter which lines get removed.
This differs from most of the questions on the web, about removing lines from text files. Most of those questions involve filtering out text files by the existence of a specific string. These lines can be removed, regardless of their content.
It doesn't actually have to be done, in VBScript. It could be a Windows batch file. But not PowerShell.
There's some sample VBScript code here, from the people who publish my VBScript IDE:
I haven't tried this yet, but it seems to open the entire file in memory. I'm not certain how much that will slow down the system, or use up whatever virtual memory we have available.
Does this script look ok? Or is there a better VBScript or Windows Shell method of shortening a text file?