Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/php
- <?php
- fclose(STDOUT); $STDOUT = fopen('F1.csv', 'w');
- define('d',";");
- define('n',"\n");
- $f_=file('F1_.csv',FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
- $szurj=array();
- foreach($f_ as $i=>$f){
- if ($i==0) continue;
- $x=explode(d,$f);
- if ( empty($szurj[$x[0].d.$x[3].d.$x[6].d.$x[8]])) $szurj[$x[0].d.$x[3].d.$x[6].d.$x[8]]=$x[7];
- else { if ($szurj[$x[0].d.$x[3].d.$x[6].d.$x[8]]<$x[7]) $szurj[$x[0].d.$x[3].d.$x[6].d.$x[8]]=$x[7];}
- }
- foreach($f_ as $i=>$f){
- if ($i==0) {print $f.n; continue;}
- $x=explode(d,$f);
- if (empty($szurj[$x[0].d.$x[3].d.$x[6].d.$x[8]])) continue;
- if ($szurj[$x[0].d.$x[3].d.$x[6].d.$x[8]]!=$x[7]) continue;
- print implode(d,$x).n;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement