> Since you haven't provided the original data, it's a
> bit difficult to
> give advice. There's nothing here, for instance, to
> show what you hope
> to gain by splitting the string into characters. It
> looks to me like
> you have CSV and want to split on the commas:
Jay the original data I posted 3 or so emails ago, but
here it is, all on one line.
:)
'msgagt=ESM_WMB_AIX,sec_id=Sec_id,severity=Low,node=test,msgnode=qwmbap01.cardinalhealth.net,utc={2007-04-26
18:01:59.472+00:00},om={UID=3a7affd6-f420-11db-80b1-000000000000,AlertCode=AEM001,AlertType=AEM-default,AppName=AEM-CommonService2,Message=5004:An
error has been reported by the BIPXML4C
component.:XML}' '[EMAIL PROTECTED]
Code is:
#!/usr/bin/perl
use strict;
use warnings;
#use diagnostics;
use Data::Dumper;
my $ovo = qq(/home/dbsmith/out);
my (@chars,$char) = ();
my $msgagt = qr/(\w+\=\w+\,)/is;
open (my $out, "+<", $ovo) or die "file '$ovo' was not
opened $!";
while (<$out>) {
s/^\s+|\s+$//g; # rid of newlines at begin and
end
next unless length $_; ## skip line of length
undef
if (/$msgagt/) {
push @chars, $_;
}
}
## Have not coded last part to grab om{...
maybe best solution is a hash while splitting on /=/,
but I tried this and did not get it to work.
I only need out of this :
msgagt=ESM_WMB_AIX
sec_id=Sec_id
severity=Low
msgnode=qwmbap01.cardinalhealth.net
utc={2007-04-26 18:01:59.472+00:00}
om={
UID=3a7affd6-f420-11db-80b1-000000000000
AlertCode=AEM001
AlertType=AEM-default
AppName=AEM-CommonService2
Message=5004:An error has been reported by the
BIPXML4C component.:XML
}
____________________________________________________________________________________Got
a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/