As an old awk head I would first reach for this simple perl-based approach:
#!/usr/bin/perl use strict; use warnings; $/ = '#'; print sort (<DATA>); __DATA__ #12346 orange #12345 apple banana #12344 pear
Note that this uses a lexical sort which somewhat coincidentally works for the given data set. If your actual data set is more varied you will probably need to use a different sorting block.
In reply to Re: Ordering data in a file.
by hippo
in thread Ordering data in a file.
by tracer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |