I want to read file name(A/B/C/D) and call the convenable function for each file in Files folder and then process the next file (pass automatically to the next file and function).
I have multiple files stored in File_folder folder:
Here is the directory structure:
App/
├─ main.py
└─ Files/
| └─B.txt
| └─A.xlsx
| └─D.xlsx
| └─C.csv
└─ File_output/
I have multiple functions stored in main.py:
def A_fct(fileA):
pass
def B_fct(fileB):
pass
def C_fct(fileC):
pass
def D_fct(fileD):
pass
def E_fct(fileE):
pass
def F_fct(fileF):
pass
Example:
read file Name B.txt => call B_fct
read file Name A.xlsx => call A_fct
etc ...
How can i do this please!
I have read all the suggestions belows but still don't know how to do it.