"link list.tmp1" is like this...
<a href="http://www.sitex.com/">Site X</a>
<a href="http://www.sitey.com/">Site Y</a>
<a href="http://www.sitem.com/">Site M</a>
<a href="http://www.siten.com/">Site N</a>
<a href="http://www.sitez.com/">Site Z</a>
I mean, it is a text link list.
I need to add all these links to a table, but if I add it like...
<table>
<tr>
<td>*text link 1*</td>
<td>*text link 2*</td>
<td>*text link 3*</td>
<td>*text link 4*</td>
</tr>
<tr>
<td>*text link 5*</td>
<td>*text link 6*</td>
<td>*text link 7*</td>
<td>*text link 8*</td>
</tr>
</table>
...and my visitors want to read it by alphabetic order, they will have
to read it from left to right, then down, then from left to right, then
down and so on, but I want my visitors to be able to read it by
alphabetic order from top to bottom, then right, then from top to
bottom, then right and so on...
I want my table to be like this...
<table>
<tr>
<td>*text link 1*</td>
<td>*text link 3*</td>
<td>*text link 5*</td>
<td>*text link 7*</td>
</tr>
<tr>
<td>*text link 2*</td>
<td>*text link 4*</td>
<td>*text link 6*</td>
<td>*text link 8*</td>
</tr>
</table>
There are 47 links in "link list.tmp1". These links need to be sorted
in the order that I want in the table. I am trying to do that! Here
goes more progress.
#!C:\Programas\xampplite\perl\bin\perl.exe
print "Content-type: text/html\n\n";
open(OLDLIST, "<link list.tmp1");
open(NEWLIST, ">link list.tmp2");
$count=1;
$up1=0;
$up2=0;
$place=1;
@newlist=();
foreach $line(<OLDLIST>)
{
$up1=int $count / 12;
$up2=int $count % 12;
$place=($up1 + 1) * 12 + ($up2 + 1);
$newlist[$place]=$line;
$count++;
};
print NEWLIST @newlist;
close(NEWLIST);
close(OLDLIST); |