At 11:19 pm +0100 29/1/04, Eelco Alosery wrote:


the strings are formated this way

01-12-2003|some text|soem other text|
03-12-2003|some text|soem other text|
10-12-2003|some text|soem other text|


Then it's very simple:


my @temp; my @lines = split "\n", <<_; 01-12-2003|some text|soem other text| 03-12-2003|some text|soem other text| 10-12-2003|some text|soem other text| 06-12-2003|some text|soem other text| 04-12-2003|some text|soem other text| _ for (@lines) { s~^(..)-(..)-(....)(.+)~$3$2$1$4~; push @temp, $_ ; } for (sort @temp) { s~(....)(..)(..)(.+)~<div>$3-$2-$1$4</div>\n~; print; }

You would substitute <FILEHANDLE> for @lines

JD



Reply via email to