in reply to Parsing a csv file from Exchange
Then you've got a data structure as the following (Hash of Arrays):my %emails = (); foreach ( split(/\%/, $emailcolumn) ) { if ( my ($key, $value) = split(/\s*\:\s*/, $_, 2) ) { push ( @{ $emails{$key} }, $value); } } # foreach # do something with %emails
Beware that exchange sometime delivers SMTP and smtp adresses. I think that the SMTP: is the main address, whereas the smtp: are additional addresses, but am not absolutely sure.%emails = ( SMTP => [ 'makeusbetter@domain.com', ...], X400 => [ 'c=US;a= ;p=domain ;o=domain;s=makeusbetter', ... ], smtp => [ ..., ...], CCMAIL => [..., ...] );
Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"
|
|---|