On 7/18/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
snip
Your solution has the same problem that made my final one frustratingly
ugly: if a server name is missing from the last file in the list there
will be no corresponding trailing zero in the output file for that server.
snip
The answer is to u
Rob Dixon wrote:
John W. Krahn wrote:
country wrote:
[snip]
Notice in File OUT for Server Name (wsompapgtw05),
since wsompapgtw05 does not appear in File A, the
value is replaced with '0'. How can I get perl to
place a '0' in the output file when a particular
server name appears in at leas
John W. Krahn wrote:
country wrote:
[snip]
Notice in File OUT for Server Name (wsompapgtw05),
since wsompapgtw05 does not appear in File A, the
value is replaced with '0'. How can I get perl to
place a '0' in the output file when a particular
server name appears in at least 1 of the input f
Rob Dixon wrote:
country wrote:
I have multiple CSV files (3 for this example) with
identical record layouts except that each Server Name may not be in
all of the files. Also the CSV files might not be sorted by Server
Name.
File A
Server Name,Avg CPU,P95 CPU,Avg Mem Util,P95 Mem Util
WSOMQAVPR
country wrote:
I have multiple CSV files (3 for this example) with
identical record layouts except that each Server Name may not be in
all of the files. Also the CSV files might not be sorted by Server
Name.
File A
Server Name,Avg CPU,P95 CPU,Avg Mem Util,P95 Mem Util
WSOMQAVPRA05,93.75,95.87,66
country wrote:
#!/usr/bin/perl
use strict;
use warnings;
###
# Create File with Average CPU Numbers
###
my %resultacpu;
my @files = qw( FileA FileB FileC );
for my $file ("FileA","FileB","FileC") {
for my $i (
country wrote:
I have multiple CSV files (3 for this example) with
identical record layouts except that each Server Name may not be in
all of the files. Also the CSV files might not be sorted by Server
Name.
File A
Server Name,Avg CPU,P95 CPU,Avg Mem Util,P95 Mem Util
WSOMQAVPRA05,93.75,95.87,66
> -Original Message-
> From: country [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 18, 2007 06:00
> To: beginners@perl.org
> Cc: [EMAIL PROTECTED]
> Subject: Combining Records From Multiple Files based on
> Common Key Values
>
> I have multiple CSV files (3 for this example) with
> i