How can I modify the following script to that it displays each value in its corresponding colum:
The body of the script looks like this:
( $vmdisk, $totalio, $readpercentage, $cachehitpercentage, $currentkbpersecond,
$maximumkbpersecond, $currentiopersecond, $maximumiopersecond
) = split (",", $line);
$totalio =~ s/\"//g;
$readpercentage =~ s/\"//g;
$cachehitpercentage =~ s/\"//g;
$currentkbpersecond =~ s/\"//g;
$maximumkbpersecond =~ s/\"//g;
$currentiopersecond =~ s/\"//g;
$maximumiopersecond =~ s/\"//g;
print "totalio:$totalio readpercentage:$readpercentage cachehitpercentage:$cachehitpercentage currentkbpersecond:$currentkbpersecond maximumkbpersecond:$maximumkbpersecond currentiopersecond:$currentiopersecond maximumiopersecond:$maximumiopersecond";
This will display this type of formatted output:
totalio:75.0 readpercentage:20.0 cachehitpercentage:93.3 currentkbpersecond:33.8 maximumkbpersecond:33.8 currentiopersecond:15.0 maximumiopersecond:15.0
everything is in one line. My goal is to get the output into columns and make it more readable. For example like this:
totalio readpercentage cachehitpercentage
75.00 20.0 93.0
How can I do this?
Formats would be something to consider especially if you were taking these measurements several times and printing to stdout or a log file. perldoc perlform
Would give you output like so: