in reply to Re: greping for a value
in thread new : greping
Cheersuse strict; use warnings; my %devices; $_ = q|device1 is 2.3.5.1 . . . 56% /var 38% / 31% Interleaved device1 + Tue Sep 9 11:26:44 ist 2005 logging to device2 is 2.3.5.1 . . . 56% +/var 44% / 31%|; my @arr = /(device\d+)\sis\s.+?\/var\s+(\d+%)/g; %devices = @arr; open(XLS, ">/path/to/file.xls") or die "Could not open file: " . $!; foreach my $device (sort keys (%devices)) { print XLS $device . "\t" . $devices{$device} . "\n"; } close XLS;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: greping for a value
by pingme8705 (Acolyte) on Sep 08, 2005 at 04:18 UTC |