pbassnote has asked for the wisdom of the Perl Monks concerning the following question:
I have a csv file that among other data, for this particular problem, contain these fields: 1) employee_name, 2) employee_group, 3) manager_name . For some of the employee_name entries, the group entries are empty (null). So, since the managers are also listed as employees in this file, I would like to be able to do a look up on their entries to copy their group information into the null entries of their corresponding employees, and I don't know how to code this. I'm thinking the pseudo-code might be something like:
if $element->[employee_group] = "" then (go to $element->[manager_name] copy $element->[manager's_group] to $element->[employee_group]);
So, this is an idea of what it might look like.
Sam Malone,Cheers,Rebecca Howe Woody Boyd,,Rebecca Howe Rebecca Howe,Cheers,Rebecca's Manager
You can see that Woody's group info is missing - null. So I'd like the code to go to Woody's manager, Rebecca Howe, and copy her group info to Woody's missing group field to make the file as such:
Sam Malone,Cheers,Rebecca Howe Woody Boyd,Cheers,Rebecca Howe Rebecca Howe,Cheers,Rebecca's Manager
Thanks, Gurus!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Field data missing; copying from other field
by Athanasius (Archbishop) on Oct 13, 2014 at 16:48 UTC | |
|
Re: Field data missing; copying from other field
by Eily (Monsignor) on Oct 13, 2014 at 17:00 UTC |