title: how to rename multiple files in a multiples directories whit the name of each directory
body: <p>i have a problem renaming all files in a folder, i found a simple solution to this here:</p>
  <p><a href="https://stackoverflow.com/questions/14306117/rename-files-in-multiple-directories-to-the-name-of-the-directory">Rename files in multiple directories to the name of the directory</a></p>
  <p>but what i notice is that it only works for single file within that folder, how can do it for multiples directories with multiple files inside each one</p>
  <p>i have this example</p>
  <pre><code>test_folder/
     results_folder1/
       file_1.csv
       file_2.csv
       file_3.csv
       file_4.csv
       ...
  
     results_folder2/
       file_1.csv
       file_2.csv
       file_3.csv
       file_4.csv
       ...
  </code></pre>
  <p>to get this</p>
  <pre><code>test_folder/
     results_folder1/
       results_folder1_1.csv
       results_folder1_2.csv
       results_folder1_3.csv
       results_folder1_4.csv
       ...
  
     results_folder2/
       results_folder2_1.csv
       results_folder2_2.csv
       results_folder2_3.csv
       results_folder2_4.csv
       ...
  
  </code></pre>
  <p>I guess I can use rename, but how can made for this situation,
  thanks in advance for everyone</p>