in reply to Re: read the whole folder files
in thread read the whole folder files
#!/usr/bin/perl -w use strict; use Data::Dumper; # this is a core module # no "installation" is required my $line = "meter_read energy_consumption n 00_1 34 n 00_2 53 n 00_3 1 +21\n"; # # this extracts number pairs and puts them into a hash # my %hash = $line =~ m/([\d_]+)\s+(\d+)/g; print Dumper \%hash; __END__ $VAR1 = { '00_2' => '53', '00_3' => '121', '00_1' => '34' };
|
|---|