[REBOL] Re: Sorting non-REBOL data
From: gregg:pointillistic at: 1-Mar-2010 10:09
SW> I have to create a text file of 49-byte records (lines) in a
SW> fixed format, to create an interface between two systems. I build
SW> it in memory and it looks like the sample below.
SW> 122998 720095 100109 00006000 3 ACH
SW> 123472 541099 100109 00050216 1 201
SW> 123473 541099 100109 00047164 1 201
It's not clear from the doc string for SORT, but it won't treat a
string as records made up of characters. But never fear, you can use
PARSE/ALL x "^/" to split your string into a block of records (or just
build it up that way initially), sort that block, and then rebuild the
string or use WRITE/LINES to save it.