in reply to Sort large files

I suggest you try using a relational database to do the job for you. I'm not claiming that this will work for datasets as large as yours, but give it a try.

MySQL sample code:
CREATE DATABASE sorter; USE sorter; CREATE TABLE t619575 ( c01 varchar(2), -- SK c02 integer, -- 1242 c03 integer, -- 0180010100 c04 varchar(3), -- AAR c05 varchar(3), -- CPH c06 varchar(3), -- AAR c07 integer, -- 0735 c08 varchar(3), -- CPH c09 integer, -- 0810001 c10 bigint(25), -- 20070521200705211 c11 varchar(2), -- SK c12 integer -- 1242 ); -- Assuming tab separated columns LOAD DATA LOCAL INFILE '619575.csv' INTO TABLE t619575 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\'; -- Add index on the fields to sort ALTER TABLE t619575 ADD INDEX idx_c02_c03_c04 (c02, c03, c04); -- Create sorted output SELECT * INTO OUTFILE '619575.sorted.csv' FROM t619575 ORDER BY c02, c03, c04 ;
Some may claim that MySQL isn't up for this kind of job. If it doesn't, then you might consider downloading the free (as in gratis) versions of Oracle or DB2.
--
print map{chr}unpack(q{A3}x24,q{074117115116032097110111116104101114032080101114108032104097099107101114})