[REBOL] Re: Sort by first part of line
From: al:bri:xtra at: 7-Sep-2002 10:49
With Louis' data and this script:
Rebol []
Then: now/time
Data: sort/skip map read/lines %test.txt
function [Line [string!]] [Loaded] [
trim Line
if not empty? Line [
Loaded: load/next Line
reduce [
Loaded/1
Line
]
]
] 2
write/lines %Sorted.txt map Data
func [N [integer!] Line [string!]] [
Line
]
print now/time - Then
halt
I got a time of two seconds (0:00:02) on my machine with Rebol/View. It's a
AMD Athlon XP 1600+, 1.40GHz with 512MB of RAM.
The first line of %Sorted.txt is:
002 umwn merimnwn dunatai prosqeinai epi thn hlikian
and the last line is:
521 tou qeou
I suspect that my machine's hardware makes most of the difference in time.
Louis, if you want, I can email the sorted text back to you. Just let me
know.
I hope that helps!
Andrew Martin
ICQ: 26227169 http://valley.150m.com/