Sorry about the abruptness of the main question. I seemed to have forgotten my manners.
What I am trying to do is sort results from a database into a predefined format. The results always come out sorted from the database and I want to rearrange them.
And a little add on to that question
What do I need to do if I have two (or more) columns seperated by semi-colons but I only want to sort by the first one?
These maybe simple problems but this is my first attempt at using perl to manipulate text! And I have a looming deadline. So be gentle.
2;3425; 2;4534; 2;2155; 3;1324; 3;1253; 3;3455; 4;3454; 4;3464; 4;3454;

Required Result

2;3425; 3;1324; 4;3454; 2;4534; 3;1253; 4;3464; 2;2155; 3;3455; 4;3454;

Thanks for all your help and please excuse those of us brought up with no manners :-P

j o h n i r l .

Sum day soon I'Il lern how 2 spelI (nad tYpe)


In reply to Re: Re: Text Manipulation Quickie by johnirl
in thread Text Manipulation Quickie by johnirl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.