home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
progmisc
/
euphor10.zip
/
FILESORT.EX
< prev
next >
Wrap
Text File
|
1993-05-07
|
615b
|
28 lines
-- Read in a file, sort it, and write it out.
-- Much faster than MS-DOS sort command.
-- Will use extended memory to quickly sort files much larger than
-- what MS-DOS sort can handle.
-- usage: ex filesort < source > dest
include sort.e
procedure file_sort()
sequence buffer, sorted_buffer
object line
buffer = {}
while 1 do
line = gets(0)
if atom(line) then
exit
end if
buffer = append(buffer, line)
end while
sorted_buffer = sort(buffer)
for i = 1 to length(sorted_buffer) do
puts(1, sorted_buffer[i])
end for
end procedure
file_sort()