Advertisement
Guest User

Untitled

a guest
Aug 12th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <h1>Renaming tool</h1>
  2.  
  3. <?php
  4.  
  5.  
  6.   $input_location = 'input/';
  7.   $input_data = 'rename.csv';
  8.  
  9.   $file_handle = fopen($input_data, "r");
  10.  
  11.   while (!feof($file_handle) ) {
  12.     $line_of_text = fgetcsv($file_handle, 1024);
  13.     rename($input_location.$line_of_text[0], $input_location.$line_of_text[1]);
  14.   }
  15.  
  16.   echo('renamed all files');
  17.  
  18.   fclose($file_handle);
  19.  
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement