in reply to Re: arranging the csv file
in thread arranging the csv file
Hi Loops,
Nice concept of solution, but you are "throwing" away the return values of the map function, so really, I wouldn't build my hash data like this. Moreover, this method is throwing a warnings Argument "\n" isn't numeric in addition ...
I would rather do like so:
use strict; use warnings; my %data; while(<DATA>){ my ($key,$value) = split/\s+|,/=>$_,2; $data{$key} = $value; } print $_,',',$data{0+$_},$/ for qw( 10.1 100.1 25.1 103.1 ); __DATA__ 100.1,A ,25, 36,56,89,45,36,56 25.1 ,B,232,565,65,56,56,48,25 103.1,C,25,5,6,9,4,5,56,889,9 10.1,D,5,6,5,8,9,8,12,23,36,6
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: arranging the csv file
by hdb (Monsignor) on Jul 24, 2013 at 07:03 UTC | |
by Anonymous Monk on Jul 24, 2013 at 07:13 UTC | |
by hdb (Monsignor) on Jul 24, 2013 at 07:18 UTC |