Created
March 10, 2017 15:02
-
-
Save hadrienblanc/f546dec0adbc5692377867b86e37e4e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("parse_csv.php"); | |
$data = parse_csv(file_get_contents("forward.csv")); | |
$people = parse_csv(file_get_contents("people.csv")); | |
$top = "name,code,master,member0,member1,member2,member3,member4,member5,member6,member7"; | |
$eip_groups = explode("\n", | |
"addiscover | |
abirato | |
aura | |
avm | |
bringtous | |
clev | |
colt | |
dataforall | |
datasplit | |
fearless | |
firefly-bot | |
food-o | |
frenchy | |
healfeed | |
histoiredepoche | |
home-e | |
huki | |
infinityjaw | |
ioscreen | |
iotsec | |
isiko | |
lena | |
start | |
mapix | |
mesfactures | |
modimo | |
twist | |
sneetchy | |
now | |
octopulse | |
optigrow | |
paps | |
accio | |
predict | |
ridercompanionhelmet | |
rololens | |
roukavici | |
shapeyourcode | |
smartmouse | |
eachotter | |
soundnme | |
spacebattlearena | |
spotjob | |
supremacy | |
synapsou | |
teachmi | |
thetesseractengine | |
virtualdeck | |
wug | |
yourdirectory"); | |
//print_r($array); | |
//print_r($data); | |
$export = array(); | |
for ($i = 0; isset($eip_groups[$i]) ; ++$i) | |
{ | |
$member_position = 0; | |
for ($j = 1 ; isset($people[$j]) ; $j++) | |
{ | |
if ($eip_groups[$i] == strtolower($people[$j][0])) | |
{ | |
$export[$eip_groups[$i]]["member" . $member_position] = $people[$j][1]; | |
$member_position++; | |
} | |
} | |
} | |
//print_r($export); | |
echo "name,code,master,member0,member1,member2,member3,member4,member5,member6,member7\n"; | |
for ($i = 0; isset($eip_groups[$i]) ; ++$i) | |
{ | |
$member_position = 0; | |
echo $eip_groups[$i] . ", "; | |
for ( $member_position = 0; isset($export[$eip_groups[$i]]["member" . $member_position]) ; $member_position++ ) | |
{ | |
echo $export[$eip_groups[$i]]["member" . $member_position]; | |
$tmp = $member_position + 1; | |
if (isset($export[$eip_groups[$i]]["member" . $tmp])) | |
{ | |
echo ", "; | |
} | |
} | |
echo "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment