in reply to Sort textfile

Why not just use sort?
$ cat junk dec.x.bc.00041669 1067503 1067501 dec.x.bc.00019580 1067503 1067501 dec.x.bc.00016113 1067503 1067501 $ sort junk dec.x.bc.00016113 1067503 1067501 dec.x.bc.00019580 1067503 1067501 dec.x.bc.00041669 1067503 1067501

Plankton: 1% Evil, 99% Hot Gas.