Re: Combining Records From Multiple Files based on Common Key Values

2007-07-18 Thread Chas Owens
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

Re: Combining Records From Multiple Files based on Common Key Values

2007-07-18 Thread John W. Krahn
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

Re: Combining Records From Multiple Files based on Common Key Values

2007-07-18 Thread Rob Dixon
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

Re: Combining Records From Multiple Files based on Common Key Values

2007-07-18 Thread Rob Dixon
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

Re: Combining Records From Multiple Files based on Common Key Values

2007-07-18 Thread John W. Krahn
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

Re: Combining Records From Multiple Files based on Common Key Values

2007-07-18 Thread Mr. Shawn H. Corey
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 (

Re: Combining Records From Multiple Files based on Common Key Values

2007-07-18 Thread Rob Dixon
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

RE: Combining Records From Multiple Files based on Common Key Values

2007-07-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -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