Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python move all txt files

from pathlib import Path

src_path = '	mpfiles_to_move'

for each_file in Path(src_path).glob('*.*'): # grabs all files
    trg_path = each_file.parent.parent # gets the parent of the folder 
    each_file.rename(trg_path.joinpath(each_file.name)) # moves to parent folder.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #move #txt #files
ADD COMMENT
Topic
Name
9+1 =