D
Deepu
Hi All,
I am trying to generate a bar chart after creating a table out of the
information in a file.
I have file which contains so many other details and have a line in the
file which start with:
#RESULT: 30 => YES: 10 NO: 10 UNKNOWN: 10
I have several files with each file have a line with RESULT.
The code to store the number of YES, NO and UNKNOWN:
#!/usr/bin/perl
@dirList= qw(FILE1 FILE2 FILE3 FILE4 FILE5);
foreach $dir (@dirList) {
open (PH, "$dir") || die "Can not open:$dir";
while (<PH>) {
if (/#RESULT: (\d+) => YES: (\d+) NO: (\d+) UNKNOWN: (\d+)/) {
push (@yesArray, $2);
push (@noArray, $3);
push (@unknownArray, $4);
}
}
close (PH);
}
Now i am trying to display it in a table format:
YES NO UNKNOWN
FILE1 10 8 14
FILE2 6 7 20
FILE3 18 10 10
FILE4 20 12 10
FILE5 10 10 10
After printing this out how to create abar chart out of it in perl with
X axis showing FILE number and has 3 bars for each file.
Thanks for the help.
I am trying to generate a bar chart after creating a table out of the
information in a file.
I have file which contains so many other details and have a line in the
file which start with:
#RESULT: 30 => YES: 10 NO: 10 UNKNOWN: 10
I have several files with each file have a line with RESULT.
The code to store the number of YES, NO and UNKNOWN:
#!/usr/bin/perl
@dirList= qw(FILE1 FILE2 FILE3 FILE4 FILE5);
foreach $dir (@dirList) {
open (PH, "$dir") || die "Can not open:$dir";
while (<PH>) {
if (/#RESULT: (\d+) => YES: (\d+) NO: (\d+) UNKNOWN: (\d+)/) {
push (@yesArray, $2);
push (@noArray, $3);
push (@unknownArray, $4);
}
}
close (PH);
}
Now i am trying to display it in a table format:
YES NO UNKNOWN
FILE1 10 8 14
FILE2 6 7 20
FILE3 18 10 10
FILE4 20 12 10
FILE5 10 10 10
After printing this out how to create abar chart out of it in perl with
X axis showing FILE number and has 3 bars for each file.
Thanks for the help.