plirof2

ZX SGD entry creation from 8.3 files v03

Apr 12th, 2022 (edited)
962
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.59 KB | None | 0 0
  1. <?php
  2.  
  3. $temp_files = glob(__dir__.'/*');
  4. //$mypath='/mnt/home/downloads_linux/fun__/SPECTRUM/fun-games/itch.io_220410/';
  5. $mypath='/mnt/home/downloads_linux/fun__/SPECTRUM/fun-games/itch.io_220310/';
  6. $temp_files = glob($mypath.'*');
  7. echo"<pre>";
  8. foreach($temp_files as $file) {
  9.     // [\w\d]{0,8}\.\w{2,4}
  10.     $file =str_replace($mypath,"",$file);  
  11.     ///if (preg_match('/[\w\d]{0,8}\.\w{2,4}/i',$file, $output_array)) echo "<BR> $file";
  12.     //preg_match('/[\w\d]{0,8}\.\w{2,4}/i',$file, $output_array) ;
  13.     preg_match('/[\w\d]{0,8}\.(tap|z80|sna|tzx)/i',$file, $output_array) ;
  14.  
  15.     if(  isset($output_array[0])  &&  $file==$output_array[0] ) {
  16.         $filename_array=explode('.',$file);
  17.         $game_name = str_pad($filename_array[0],  37, " ");  
  18.         $filename_main = str_pad($filename_array[0],  8, " ");  
  19.         //echo "<hr>$filename_main";
  20.         //$name_ext = str_pad($filename_array[0],  8, "___");  
  21.         //echo "<BR> $file  : ".$output_array[0]."   filename : ".$filename_main.".".$filename_array[1];
  22.  
  23.     //echo "<BR> $file";
  24.         $db_line_ORIG='Adventure Time - Flame Princess      2010                                      128 1         advtime .TAP Arc     27    43441        0 -1     Eng   0                                                                                                    
  25. ';
  26.     $db_line=$game_name."2010                                      128 1         ".$filename_main.".".$filename_array[1]." Puz     27    43441        0 -1     Eng   0                                                                                                    
  27. ";
  28.     //echo "\n$db_line";
  29.     echo "$db_line";
  30.  
  31.     }
  32. }
  33. echo"</pre>";
  34. ?>
Add Comment
Please, Sign In to add comment