Hi everyone I´m trying now to move some files from one folder to another. The files that i have are
- results_1_1
- results_2_1
- results_3_1
- results_1_2
- results_2_2
- results_3_2
What i´d like to get is to move files
- results_1_1
- results_2_1
- results_3_1 to one folder let´s call it A
other
- results_1_2
- results_2_2
- results_3_2 to another let´s call it B
I don´t want to do it manually because, in reality, I have much more files
I have created by python a new folder that I want to have
and so far about moving the files to another directory
import shutil
source_folder = r"C:/Users/...."
destination_folder= r"C:/Users/...."
files_to_move = ['results_1_3.dat']
for file in files_to_move:
source = source_folder + file
destination = destination_folder + file
shutil.move(source,destination)
print("Moved!")
But with this program I can only move one file at a time I tried writing results_.+3.dat', results*_3.dat' but I´m seeing an error all the time