Gossamer Forum
Home : Products : DBMan : Customization :

Counting from any field...

Quote Reply
Counting from any field...
This is the code:
open (DB, "<$db_file_name") or &cgierr("error in count. unable to open database: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
@lines = <DB>;
close DB;

foreach $line (@lines) {
chomp ($line);
@data = &split_decode($line);
++$count{$data[4]};
++$total_count;
}
Where the ++$count {$data[4]} is suppose to be to count the data in field number four. I would like to change that so that it will could from any field that contains the data that is to be counted. i.e. ($count{'Ms'})
Text file is located at http://www.jse.net/html_pl.txt

------------------
Sherwin Sales@jse.net
Subject Author Views Date
Thread Counting from any field... Sherwin 973 Jan 29, 2000, 4:32 AM
Post Re: Counting from any field...
Sherwin 931 Jan 30, 2000, 9:14 PM