Thanks John,

And when i use this part to open the data file

open (DATABASE, "$database") || die "Can't Open $klantfile";
while(<DATABASE>)
{
($date, $text1, $text2) = split(/\|/,$_);
foreach ($date)
{               
print <<ENDOFTEXT;

some html text
ENDOFTEXT
}
}
close (DATABASE);

how do i combine this together




Op 29-jan-04 om 23:58 heeft John Delacour het volgende geschreven:



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