Jump to content

Fast text file sorting


 Share

Recommended Posts

Hi All,

I have a text file that I would like to sort. It is a delimited data file consisting of 4 fields per line, with the required sort field as the first field. The test file has ~7500 lines in it.

I have tried reading each line, using StringSplit(), loading the values into a 2 dimensional array, and then using _ArraySort. I have also tried reading each line as a whole, and sorting as a 1 dimensional array, but it is very slow.

I have found using the 'sort.exe' command supplied with win2k/XP (not sure about earlier versions of Windows), the file is sorted in the blink of an eye.

Do you think it's worth trying to code a faster sort routine? Personally, I am inclined to just use the external sort program.

Link to comment
Share on other sites

  • Developers

Do you think it's worth trying to code a faster sort routine? Personally, I am inclined to just use the external sort program.

Don't think you can beat the external sort program in this case....

AutoIT3 doesn't have an internal sort option, we only have UDF which will always be slower.....

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...