Hi, Andrew,
Thanks for your script. It worked fine except one problem:
It won't preserve the original format of the file. e.g
30-Jan-2000 4 6 (before sort)
30-Jan-2000 4 6 (after sort)
Any suggestion about how to fix it?
Thanks a lot.
Tiana
____________________Reply Separator____________________
Subject: [REBOL] problem with sort a file Re:(3)
Author: <[EMAIL PROTECTED]>
Date: 2/10/00 11:20 PM
Try this:
write %foo.txt
{2-Feb-2000 1 2
1-Feb-2000 2 1
6-Feb-2000 3 5
24-Feb-2000 4 6}
Lines: read/lines %foo.txt
Block: make block! 100
foreach Line Lines [
append/only Block load Line
]
print mold Block
sort Block
print mold Block
delete %foo.txt
foreach Line Block [
write/append %foo.txt rejoin ["" line newline]
]
print read %foo.txt
Andrew Martin
REBOLutionary in NZ...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-