<?xml version="1.0" encoding="windows-1252"?>
<node id="83717" title="Re: Sorting issues" created="2001-05-28 11:08:36" updated="2005-07-19 14:08:39">
<type id="11">
note</type>
<author id="74710">
zeidrik</author>
<data>
<field name="doctext">
If You insist on "sort" here is my way to do it:&lt;BR&gt;
for the database as
&lt;code&gt;
1 2 3 |10
a b c |20
e f g |100
x n f |1
&lt;/code&gt;
the code
&lt;code&gt;
#!/usr/bin/perl -w
use strict;
my %H;
open(R,"database");
 map {/\|(\d+)/; $H{$1}=$_ if $1}&lt;R&gt;;
close(R);
 foreach (sort {$a&lt;=&gt;$b} keys %H){print $H{$_}}
&lt;/code&gt;
does exactly:
&lt;code&gt;
x n f |1
1 2 3 |10
a b c |20
e f g |100
&lt;/code&gt;

Enjoy...</field>
<field name="root_node">
83509</field>
<field name="parent_node">
83509</field>
</data>
</node>
