Sign in to follow this  
Followers 0
photonbuddy

Fast text file sorting

2 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0