R
robertchen117
hi all,
the log file format is a long list of the item like:
Fri Oct 6 00:00:23 2006: TR_execute_task( Lib/Task: library_name1/
task_name2 run by www.hp.com on 7 targets, out = 257
I want to count the number of targets based on library_name1/
task_name2, but there are many library names and task names, so the
array size not know. How could I do this?
My perl codes is like this:
.....
open (TSK, "more /tmp/task28.log | grep '$now' | grep 'out =' |") or
die "cannot fork: $!";
while (<TSK>) { # count them up.
($foo,$foo,$foo,$time,$foo,$foo,$foo,$taskinfo,$foo,$foo,$foo,
$foo,$targets,$foo,$foo,$foo, $bytes) = split ' ';
should be like array[$taskinfo] += $targets;
How could I define the array or hash dynamicly?
Please help me, thanks.
the log file format is a long list of the item like:
Fri Oct 6 00:00:23 2006: TR_execute_task( Lib/Task: library_name1/
task_name2 run by www.hp.com on 7 targets, out = 257
I want to count the number of targets based on library_name1/
task_name2, but there are many library names and task names, so the
array size not know. How could I do this?
My perl codes is like this:
.....
open (TSK, "more /tmp/task28.log | grep '$now' | grep 'out =' |") or
die "cannot fork: $!";
while (<TSK>) { # count them up.
($foo,$foo,$foo,$time,$foo,$foo,$foo,$taskinfo,$foo,$foo,$foo,
$foo,$targets,$foo,$foo,$foo, $bytes) = split ' ';
should be like array[$taskinfo] += $targets;
How could I define the array or hash dynamicly?
Please help me, thanks.