Login   Register  
PHP Classes
elePHPant
Icontem

External Sort: Sort large files similar to the UNIX sort command

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Philipp Strazny
Name: Philipp Strazny is available for providing paid consulting. Contact Philipp Strazny .
Packages: 5 Browse all classes by Philipp Strazny Browse all classes by
Country: United States United States - PHP jobs in United States
Age: 47
All time rank: 1584212 in United States United States
Week rank: 579 Up60 in United States United States Up
Innovation award
Innovation award
Nominee: 3x

Winner: 1x


  Detailed description   Download Download .zip .tar.gz  
This class can sort large files similar to the UNIX sort command.

It can read the file to be sorted in small buckets associated to temporary files to not exceed the configured PHP memory limits.

The buckets are sorted individually and then merged to produce the final sorted output.

The class provides command line interface options so it can be executed as a command from a shell.

  Classes of Philipp Strazny  >  External Sort  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: External Sort
Base name: external-sort
Description: Sort large files similar to the UNIX sort command
Version: -
PHP version: 5
License: Freely Distributable
All time users: 298 users
All time rank: 6430
Week users: 1 user
Week rank: 1808 Up
 
  Groups   Screenshots Screenshots   Freshmeat project  
  Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image Algorithms Numerical and statistical algorithms View top rated classes
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Text processing Manipulating and validating text data View top rated classes
Group folder image Console Command line and console utilities View top rated classes

  Files folder image Screenshots  
performance comparison with GNU sort
File Role Description
Accessible without login Image file efficiency_comparison.png Screen performance comparison with GNU sort


  Innovation Award  
PHP Programming Innovation award nominee
November 2011
Number 7
Sorting data is a relatively easy operation to implement in PHP using the many variants of PHP array sorting functions.

However, if you need to sort large amounts of data, that is not very easy, as it may exceed PHP configured memory limits.

This class implements an approach to sort large files similar to the Unix sort command.

It splits a file to be sorted in multiple chunks of limited size and then merges the sorted results into a final output file.

Manuel Lemos

  Freshmeat project  
Project record: externalsort
Popularity score: 15.72
Vitality score: 29.82

  User ratings  
Not yet rated by the users

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Plain text file ExternalSort.php Class the external sorting application
Accessible without login HTML file ExternalSort_about.htm Doc. explanations, examples, performance
Accessible without login Plain text file BucketCollectionTest.php Test unit tests for BucketCollection utility class
Accessible without login Plain text file ExternalSortTest.php Test unit tests for ExternalSort
Accessible without login Plain text file License Lic. Academic Free License

Download Download all files: external-sort.tar.gz external-sort.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.