#!/usr/bin/perl
use strict;
use warnings;
my $str = <DATA>;
my @origcols = split /,/,$str;
my @cols = ();
foreach (@origcols) {
$_ =~ s/\.//g;
push ( @cols , $_ ) unless /Bandwidth.*|MSTCPLoop.*/ ;
}
map {print $_,$/ } @cols;
__DATA__
PDHCSV40EasternDaylightTime.240,ERWW.COMMUNITIES.MemoryPagesPER.sec,ER
+WWCOMMUNITIESNetwor
kInterfaceEthernetAdapterModuleBytesTotalPERsec,ERWWCOMMUNITIESNetwork
+InterfaceEthernetAd
apterCurrentBandwidth
Output
PDHCSV40EasternDaylightTime240
ERWWCOMMUNITIESMemoryPagesPERsec
ERWWCOMMUNITIESNetworkInterfaceEthernetAdapterModuleBytesTotalPERsec
as you could see the periods are gone and no warnings. Also the column with bandwidth is not listd. Can you make sure your origcols array is correctly populated?
-SK |