Python Script Collection For File Management
Python Script Collection For File Management
Umer Saeed
BSc Electrical Engineering, MS Data Science
Department of Information System
School of Business and Economics
University of Management & Technology, Lahore, Pakistan
Sr. RF Optimization and Planning Engineer
[email protected]
banoqabil.pk
Clean up Files and Directories in a
specified Folder Path
❑The purpose of this code is to;
❑Clear Files and Directories: It aims to remove all files and directories
within a specified folder path.
❑Prevent Errors: It checks if the folder path exists before attempting
any operations to prevent potential errors.
❑Recursive Removal: If a directory is found, it removes it along with all
its contents recursively.
❑Clean-Up for Analysis: This code might be used as a preparatory step
before conducting analysis on a dataset, ensuring a clean slate for new
data.
banoqabil.pk
Clean up Files and Directories in a
Specified Folder Path
banoqabil.pk
Batch Clearing of Files and Folders in
Multiple Paths
❑The purpose of this code is to;
banoqabil.pk
Batch Clearing of Files and Folders in
Multiple Paths
banoqabil.pk
Batch File Transfer Based on Excel File
Information
❑The purpose of this code is to;
banoqabil.pk
Batch File Transfer Based on Excel File
Information
❑Move Files: For each row, it checks if the source file exists. If it does, it
creates the target directory if it doesn't exist and then moves the file.
banoqabil.pk
Batch File Transfer Based on Excel File
Information
❑Files_info.xlsx: Format of the mentioned File is given below;
File sr_Path target_Path
UMTS_CE_Utilization_31082023.zip D:/Advance_Data_Sets/Congestion/CE_Utilization D:/Advance_Data_Sets/Congestion/CE_Utilization/08_Aug_2023
GSM_Cell_Houlry_31082023.zip D:/Advance_Data_Sets/KPIs_Analysis/Hourly_KPIs_Cell_Level/GSM D:/Advance_Data_Sets/KPIs_Analysis/Hourly_KPIs_Cell_Level/GSM/Aug
LTE_Cell_Hourly_31082023.zip D:/Advance_Data_Sets/KPIs_Analysi/Hourly_KPIs_Cell_Level/LTE D:/Advance_Data_Sets/KPIs_Analysis/Hourly_KPIs_Cell_Level/LTE/08_Aug2023
UMTS_Cell_Hourly_31082023.zip D:/Advance_Data_Sets/KPIs_Analysis/Hourly_KPIs_Cell_Level/UMTS D:/Advance_Data_Sets/KPIs_Analysis/Hourly_KPIs_Cell_Level/UMTS/08_Aug2023
GSM_BTS_Hourly_31082023.zip D:/Advance_Data_Sets/TXN_DataSets/GSM_BTS_Hourly D:/Advance_Data_Sets/TXN_DataSets/GSM_BTS_Hourly/08_Aug
LTE_Hourly_BTS_Level_31082023.zip D:/Advance_Data_Sets/TXN_DataSets/LTE_TNL_BTS_Hourly D:/Advance_Data_Sets/TXN_DataSets/LTE_TNL_BTS_Hourly/08_Aug2023
LTE_Nationwide_RX_31082023.zip D:/Advance_Data_Sets/TXN_DataSets/LTE_Transmission_Link_Capacity D:/Advance_Data_Sets/TXN_DataSets/LTE_Transmission_Link_Capacity/08_Aug
UMTS_BTS_Hourly_31082023.zip D:/Advance_Data_Sets/TXN_DataSets/UMTS_Hourly_BTS D:/Advance_Data_Sets/TXN_DataSets/UMTS_Hourly_BTS/08_Aug
D:/Advance_Data_Sets/TXN_DataSets/UMTS_Transmission_Hourly/IPPATH_Hourly/
IPPath_Hourly_31082023.zip D:/Advance_Data_Sets/TXN_DataSets/UMTS_Transmission_Hourly/IPPATH_Hourly 08_Aug2023
D:/Advance_Data_Sets/TXN_DataSets/UMTS_Transmission_Hourly/IPPOOL_Hourly/
IPPool_Hourly_31082023.zip D:/Advance_Data_Sets/TXN_DataSets/UMTS_Transmission_Hourly/IPPOOL_Hourly 08_Aug2023
banoqabil.pk
Batch File Transfer Based on Excel File
Information
banoqabil.pk
Batch File Deletion Based on Excel File
Information
❑The purpose of this code is to;
banoqabil.pk
Batch File Deletion Based on Excel File
Information
❑Completion Message: After processing all rows, it provides a summary
of the deletion process.
❑DA_Files.xlsx: Format of the mentioned File is given below;
File
D:/Advance_Data_Sets/HW_Scripts/LTE_Main_Diversity/LTE_Main_Diversity_07092023.zip
D:/Advance_Data_Sets/HW_Scripts/UMTS_Main_Diversity/UMTS_Main_Diversity_07092023.zip
D:/Advance_Data_Sets/KPIs_Analysis/BH_KPIs_Cell_Level/GSM/GSM_Cell_BH_07092023.zip
D:/Advance_Data_Sets/KPIs_Analysis/BH_KPIs_Cell_Level/UMTS/UMTS_Cell_BH_07092023.zip
D:/Advance_Data_Sets/KPIs_Analysis/DA_KPIs_Cell_Level/GSM/GSM_Cell_DA_07092023.zip
D:/Advance_Data_Sets/KPIs_Analysis/DA_KPIs_Cell_Level/LTE/LTE_Cell_DA_07092023.zip
D:/Advance_Data_Sets/KPIs_Analysis/DA_KPIs_Cell_Level/UMTS/UMTS_Cell_DA_07092023.zip
D:/Advance_Data_Sets/KPIs_Analysis/Inter_BSC_HSR/KPIs/INTER_BSC_HSR_07092023.zip
D:/Advance_Data_Sets/SLA/Cluster_DA_KPIs/GSM_Cluster_DA_07092023.zip
D:/Advance_Data_Sets/SLA/Cluster_BH_KPIs/GSM_Cluster_BH_07092023.zip
D:/Advance_Data_Sets/TA_Analysis/GSM/DA/TA_Analysis_DA_07092023.zip
D:/Advance_Data_Sets/TA_Analysis/GSM/Hourly/TA_Analysis_Hourly_07092023.zip
D:/Advance_Data_Sets/TXN_DataSets/GSM_BTS_DA/GSM_BTS_DA_07092023.zip
D:/Advance_Data_Sets/TXN_DataSets/LTE_TNL_BTS_DA/LTE_BTS_DA_07092023.zip
D:/Advance_Data_Sets/TXN_DataSets/UMTS_DA_BTS/UMTS_BTS_DA_07092023.zip
D:/Advance_Data_Sets/TXN_DataSets/UMTS_Transmission_DA/IPPATH_DA/IPPath_DA_07092023.zip
D:/Advance_Data_Sets/TXN_DataSets/UMTS_Transmission_DA/IPPOOL_DA/IPPool_DA_07092023.zip
banoqabil.pk
Batch File Deletion Based on Excel File
Information
banoqabil.pk
Batch File Transfer Based on Excel
Information
❑The purpose of this code is to;
❑Note: The code assumes that the target folder structure is similar to
the source folder structure and that files with specific names should
be moved from source to target
❑p_name.xlsx: Format of the mentioned File is given below;
File Target_Folder Sr_Folder
banoqabil.pk
Batch File Transfer Based on Excel
Information
banoqabil.pk