One way to reverse lines in a file is to use revgrep(1). Revgrep was posted to net.sources by yours truly about 3 weeks ago. It does a grep, backwards, so % revgrep '^' file.dat reverses the lines of file.dat. Revgrep has no length limits. If anyone missed revgrep on net.sources and would like a copy, I will be glad to mail it (or even re-post).