The source directory contains n files, and the structure is the same for all files. The purpose of this code is — read all files one at a time, and then append the output to a single master file that is structured similar to the original files.
Taking three input files named emp_1.txt as an example, emp_2.txt , emp_3.txt , the output will contain data from all input files.
Input:Output:
Method # 1: Using the os module
|
Output:
Method # 2: Using pandas p>
|
Exit :