@י-פל העליתי כאן פעם משהו כזה בפייתון,
import os
import pandas as pd
def export_to_excel(root_path, excel_file):
data = {'Folder Path': [], 'File Name': []}
for folder_path, _, file_names in os.walk(root_path):
for file_name in file_names:
file_path = os.path.join(folder_path, file_name)
data['Folder Path'].append(folder_path)
data['File Name'].append(file_name)
df = pd.DataFrame(data)
df.to_excel(excel_file)
if __name__ == "__main__":
root_directory = input('Enter the root folder path: ')
excel_output_file = input('Enter the file output path: ')
export_to_excel(root_directory, excel_output_file)
print(f'Data exported to {excel_output_file}')
אופן השימוש:
PS C:\Users\abaye> & "C:/Program Files/Python311/python.exe" q:/new/RegistersFilesAndFolders.py
Enter the root folder path: Q:\new
Enter the file output path: Q:\new\ee.xlsx
Data exported to Q:\new\ee.xlsx