AnsweredAssumed Answered

Re2: vrf - sorting text arrays

Question asked by michael.asbery on Feb 9, 1999

I've been following this thread, and with all the idea's about counting
spaces and such, how about creating your own sorting function.  It takes in
your text array.  Then creates a temporary array of records that has two
fields - original text, and name[last,first].  Using the techniques from
the various threads, strip out the name padding the end of each string to
make all strings the same length, and stripping any leading spaces. Run a
sort(a,1,"name")  Once the array of records is sorted, output from the
function just the original text field as a 1D array.  It builds on
everyone's ideas and gives you the advantage of being able to sort by name.
This may be a memory hungry way to accomplish the task depending on the
size of your data, but you should be able to get the correct results.

Mike Asbery

Michael N. Asbery, NRL Code 5733.20, (202)404-3014, DSN 357 fax (202)404-7661