in reply to Re^2: Converting Excel to Hash
in thread Converting Excel to Hash
A hash cannot have multiple values for the same key. You will need to rethink your data structure.
Consider storing array references as values instead of hash references as values:
{ '1'=> [{ 'clz=>'nit' 'degree'=>'ph.d', 'name'=>'teja' }, { 'clz=>'iit' 'degree'=>'M.tech', 'name'=>'teja' }],####This block not coming in output '2'=>[{ 'clz=>'mit' 'degree'=>'ravi', 'name'=>'B.Tech' }] };
This change will also need changes in your code on how you fill the data structure and how you output your data structure.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Converting Excel to Hash
by ravi179 (Novice) on Jan 03, 2017 at 15:20 UTC | |
by Corion (Patriarch) on Jan 03, 2017 at 15:31 UTC | |
by ravi179 (Novice) on Jan 04, 2017 at 09:49 UTC | |
by poj (Abbot) on Jan 04, 2017 at 11:04 UTC | |
by ravi179 (Novice) on Jan 04, 2017 at 12:11 UTC | |
| |
by poj (Abbot) on Jan 03, 2017 at 16:19 UTC | |
by ravi179 (Novice) on Jan 03, 2017 at 16:25 UTC | |
by poj (Abbot) on Jan 03, 2017 at 17:26 UTC | |
by ravi179 (Novice) on Jan 04, 2017 at 11:26 UTC | |
|