Python Forum
Copy files from subfolders into same name of subfolders at other directory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy files from subfolders into same name of subfolders at other directory
#1
Hello everyone,

I need python script, which should be capable for copying files from different subfolders into new directory and this new directory should contain same subfolders. I am unable to create this sub_folders at destination during run time.
can anybody help me.

for example :
source_folder:
sub_folder1:
test1.txt
image1.jpg
sub_folder2:
test2.txt
image2.jpg
sub_folder3:
test3.txt
image3.jpg


destination_folder:
sub_folder1:
test1.txt
sub_folder1:
image1.jpg
sub_folder2:
test2.txt
sub_folder2:
image2.jpg
sub_folder3:
test3.txt
sub_folder3:
image3.jpg
Reply
#2
Please show what you  have tried so far, and where you are running into problems.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Loop through all files in a directory? Winfried 10 308 Yesterday, 07:38 PM
Last Post: FortuneCoins
  Why is the copy method name in python list copy and not `__copy__`? YouHoGeon 2 274 Apr-04-2024, 01:18 AM
Last Post: YouHoGeon
  Copy Paste excel files based on the first letters of the file name Viento 2 439 Feb-07-2024, 12:24 PM
Last Post: Viento
  uploading files from a ubuntu local directory to Minio storage container dchilambo 0 460 Dec-22-2023, 07:17 AM
Last Post: dchilambo
  change directory of save of python files akbarza 3 886 Jul-23-2023, 08:30 AM
Last Post: Gribouillis
  Using pyinstaller with .ui GUI files - No such file or directory error diver999 3 3,359 Jun-27-2023, 01:17 PM
Last Post: diver999
  Monitoring a Directory for new mkv and mp4 Files lastyle 3 1,645 May-07-2023, 12:33 PM
Last Post: deanhystad
  Create new folders and copy files cocobolli 3 1,471 Mar-22-2023, 10:23 AM
Last Post: Gribouillis
  Copy only hidden files and folders with rsync Cannondale 2 1,017 Mar-04-2023, 02:48 PM
Last Post: Cannondale
  python move folders and subfolders not working mg24 5 2,178 Nov-09-2022, 02:24 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020