I have a one folder, within it contains 5 sub-folders. Each sub folder contains some 'x.txt','y.txt' and 'z.txt' files and it repeats in every sub-folders Now I need to read and print only 'y.txt' file from all sub-folders. My problem is I'm unable to read and print 'y.txt' files. Can you tell me how solve this problem.
Below is my code which I have written for reading y.txt file
import os, sys
import pandas as pd
file_path = ('/Users/Naga/Desktop/Python/Data')
for root, dirs, files in os.walk(file_path):
for name in files:
print(os.path.join(root, name))
pd.read_csv('TextInformation.txt',delimiter=";", names = ['Name', 'Value'])
error :File TextInformation.txt does not exist: 'TextInformation.txt'