theroninwins has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
here is a little problem: I am using the ipmitool to get some infos of a hardware device.
The printout is like:
CPU 1 |3000 RPM |ok
Power Supply |unspecified |cr
and so on
I need it to be
CPU1=3000RPM=ok
Power Supply=unspecified=cr
Does anyone have an idea how to sort this one out?
here is a little problem: I am using the ipmitool to get some infos of a hardware device.
The printout is like:
CPU 1 |3000 RPM |ok
Power Supply |unspecified |cr
and so on
I need it to be
CPU1=3000RPM=ok
Power Supply=unspecified=cr
I read the lines into @saved (that works) but the rest doesn't and it overwrites the lines aas well.foreach $line(@saved) { $tmp=s/\|/\=/,$line; @sort=$tmp; } open OUTPUT, ">>ipmiinfo.txt"; print OUTPUT @sort, "\n"; close OUTPUT;
Does anyone have an idea how to sort this one out?
Back to
Seekers of Perl Wisdom