floyd Posted February 1, 2005 Report Share Posted February 1, 2005 For those really big sorting jobs that I keep reading about here in the forum ... This example macro is a companion to the original {Single Dimension Sort} macro, which sorts strings, or strings of numbers from a variable instead of a file. This script reads lines from text file and converts them into an array for sorting. Each element in the array is a line of text (or numbers) in the text file. A line ends with a CR/LF. Included is a file that contains 50,000 random lines of text and another containing 50,000 random numbers. But, feel free to create your own files for testing. My computer (2.4ghz) sorts the 50,000 word file in about 9 seconds, which includes reading the data from the input file and writing the sorted array back to the output file. Because this example generates a VBS script which does the sorting, you only need to import the attached playable (.mxe) file into any Macro Express library (.mex) file. Nothing else is required to use the sorting algorithm. There are no external files except, of course, the file that you want to sort! The attached macro is well documented. Please review the header section within it for information on the sorting options, which are: Sort all or only part of the file Sort using case or ignore case Sort in ascending or descending order SingleDimensionSort_File.zip Quote Link to comment Share on other sites More sharing options...
randallc Posted February 1, 2005 Report Share Posted February 1, 2005 Hi Floyd, Hey, that's great! I love seeing what people can do who know what they're doing and making it all look simple! - I can learn from your simplified routines. Keep it coming! Best, Randall Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.