in reply to Re: data manipulation case insensitive match
in thread data manipulation case insensitive match
Shame on me I forgot to post the data structure. Here it is:
$VAR1 = [ { 'origin' => 'IB', 'targetL' => 'Ahnenforschung', 'sourceL' => '' }, { 'sourceL' => '', 'targetL' => 'akzent', 'origin' => 'IB' }, { 'sourceL' => '', 'origin' => 'EU', 'targetL' => 'Akzent' }, { 'origin' => 'IB', 'targetL' => 'Akzent', 'sourceL' => '' } ]
Expecting:
$VAR1 = [ { 'count' => 2, 'origin' => 'IB, EU', 'targetL' => 'Akzent' }, { 'origin' => 'IB', 'targetL' => 'Ahnenforschung', 'count' => '1' } ]
My script works fine, but it counts as different entities 'Akzent' and 'akzent' which I would like to count and put togheter. The data structure is constructed in a complex way, so that this manipulation needs to be performed on the datastructure itself, and not before.
Note that 'targetL' in my first record (output) could be both 'Akzent' or 'akzent' (do not care), but I do not want to put all my datastructure to lc, i.e. I want to preserve the original as much as possible
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: data manipulation case insensitive match
by Corion (Patriarch) on Nov 16, 2019 at 16:16 UTC |