Keep It Simple, Stupid | |
PerlMonks |
Best way to parse my databy sierpinski (Chaplain) |
on Sep 30, 2009 at 16:06 UTC ( [id://798377]=perlquestion: print w/replies, xml ) | Need Help?? |
sierpinski has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have a data manipulation issue, and I'm sure it's a super-easy thing to do in Perl, I just can't get it to work... first is the data I am reading from a command output: Now, what this means is, the 'B' section is a list of which groups are running on which hosts. (This may seem familiar to anyone who has used VCS before), and the 'G' section later on in the same command output shows groups that are frozen. What I'm looking for is to be able to say "GroupX is frozen on hostY". What I've tried: - Using hashes to store 'B' information as keys, and 'G' information as values - Arrays with grep - Complex grep/awk statements - A few other things I can't recall offhand I know there has to be a really simple solution to this, but I may be thinking about it too much. There is a caveat though. These checks are happening on multiple servers at once, so if host1, host2, and host3 are all in the same cluster, the same frozen group will get reported on all 3 hosts, so I want to only report the ones that have ONLINE in the 'B' section. Hopefully that makes sense. Thanks for any ideas you can provide!
/\ Sierpinski
Back to
Seekers of Perl Wisdom
|
|