Please suggest how can we move files in different folder without using Run Command tool.
We need to move file from a folder to Archive folder after processing.
You can move files with blob tools.
Please see below,
I add a comment on the workflow to explain the steps,
Attached the workflow,
Regards,
Hi @messi007,
I want to move the files from source folder to destination folder. your workflow copy files from source folder and pasting it to destination folder. Not deleting it form the source folder.
You can do move/"cut and paste" using Python script.
#################################
import os
import shutil
from glob import iglob
#################################
def move_all_latest_files(source_dir, destination_dir):
files = os.listdir(source_dir)
if not files:
print(f"No files found in {source_dir}. Skipping processing.")
return
'''
for filename in files:
source_file = os.path.join(source_dir, filename)
destination_file = os.path.join(destination_dir, filename)
shutil.move(source_file, destination_file)
'''
for root, directories, files in os.walk(source_dir):
for filename in files:
source_file = os.path.join(root, filename)
destination_file = os.path.join(destination_dir, os.path.relpath(source_file, source_dir))
shutil.move(source_file, destination_file)
print(f"Moved all files from {source_dir} to {destination_dir}")
#################################
source_dir = r'\\Your_Source_Path'
destination_dir = r'\\Destination_Path'
move_all_latest_files(source_dir, destination_dir)