the file changes every night it is a list of website addresses pulled
off the server followed by the site's size, ever site is on its own line
followed by its size:
exactly like this:

johnw/
123
adamp/
345
pault/
2345
miket/
567


and so on, there are about 500 web sites.....


Kind Regards
Adam McGregor
[EMAIL PROTECTED]
Affinity Internet (Pty) Ltd
 


-----Original Message-----
From: Moon, John [mailto:[EMAIL PROTECTED]]
Sent: 24 July 2001 05:36
To: [EMAIL PROTECTED]
Subject: RE: counting in CGI - any pointers?


One Line of data has *foo* and another has *3* and ... OR *foo 3 bleed
45
blee 56 stuff 67 .... * ?

If it's the second can *stuff* = *stuff more stuff then still more
stuff* ? 

Is the record *fixed* or *typed* ?

-----Original Message-----
From: Adam Mc Gregor [mailto:[EMAIL PROTECTED]]
Sent: July 24, 2001 10:24
To: [EMAIL PROTECTED]
Subject: counting in CGI - any pointers?


Hi all
I have a text file that I am displaying in an html table on a website.
this text file has on line of data, set out like this:

foo
3
bleeb
45
blee
56
stuff
67

what i need to do is get it to total all the numbers in this file once
it has finished outputting the data to my table and display that total
somewhere on the page

the script i am using to output the data:

#!/usr/bin/perl
print "Content-type: text/html\n\n";

open infile, "</www/webs/affinityinternet.co.za/stats/webusage/libweb";
print <<"EOF";

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Web Site URL</title>
</head>

<body>


EOF
while (eof(infile) ne 1) {
$inline = <infile>;
chomp $inline;
@line = split (" " , $inline);
print <<"EOF";
<div align="center">
  <center>
  <table bgcolor="#787CA8" bordercolorlight="#98CCFF"
bordercolordark="#98CCFF" border="1" width="500" >
<tr>
      <td bordercolorlight="#98CCFF" bordercolordark="#98CCFF"
style="text-align: Center" width="500" >
        <p align="centre"><b><font
face="Arial">http://members.freemail.absa.co.za/$line[0]</font></b></td>

EOF
$inline = <infile>;
chomp $inline;
@line = split (" " , $inline);
print <<"EOF";

        <tr>
      <td bordercolorlight="#98CCFF" bordercolordark="#98CCFF"
style="text-align: Center" width="500" >
        <p align="centre"><b><font
face="Arial">$line[0]kb</font></b></td>
      
  </table>

EOF
}
print <<"EOF";
</body>

</html>
EOF
The information in this e-mail, and any attachment therein, is
confidential
and for 
use by the addressee only. If you are not the intended recipient, please
return the 
e-mail  to the sender and delete it from your computer. Although
Affinity
Internet 
attempts to sweep e-mail and attachments for viruses, it does not
guarantee
that 
either are  virus-free and accepts no liability for any damage sustained
as
a result
of viruses.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

The information in this e-mail, and any attachment therein, is confidential and for 
use by the addressee only. If you are not the intended recipient, please return the 
e-mail  to the sender and delete it from your computer. Although Affinity Internet 
attempts to sweep e-mail and attachments for viruses, it does not guarantee that 
either are  virus-free and accepts no liability for any damage sustained as a result
of viruses.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to