python, find and print specific cells in csv files that are in different directories
Question: I have different csv files in different directories. so i want to find
specific cells in different columns that correspond to a specific date in my
input.txt file. here is what i have until now:

    
    
    import glob, os, csv, numpy
    import re, csv
    
    if __name__ == '__main__':
    Input=open('Input.txt','r');
    output = []
    for i, line in enumerate(Input):
        if i==0:
           header_Input = Input.readline().replace('\n','').split(',');
        else:
           date_input = Input.readline().replace('\n','').split(',');
    a=os.walk("path to the directory")
    [x[0] for x in os.walk("path to the directory")]
    print(a)
    b=next(os.walk('.'))[1] # immediate child directories.
    for dirname, dirnames, filenames in os.walk('.'):
        # print path to all subdirectories first.
        for subdirname in dirnames:
          print(os.path.join(dirname, subdirname))
    
         # print path to all filenames.
        for filename in filenames:
          #print(os.path.join(dirname, filename))
          csvfile = 'csv_file'
          if csvfile in filename:
            print(os.path.join(dirname, filename))
    

Now I have the csv files, so i need to find the date_input in every file, and
print the line that contains all the information. Or if possible, to get only
the cells that are in the columns with header == header_input.


Answer: This is not intended to be a full answer to your question. But you may want to
consider replacing

    
    
    for i, line in enumerate(Input):
        if i==0:
           header_Input = Input.readline().replace('\n','').split(',');
        else:
           date_input = Input.readline().replace('\n','').split(',');
    

with

    
    
    header_Input = Input.readline().strip().split(',')
    date_input = Input.readline().strip().split(',')
    

The `enumerate(Input)` expression reads lines from the file, and so do calls
to `readline()` in the loop body. This will most likely result in some
unfortunate results like reading alternating lines from the file.

The `strip()` method removes whitespace from the start and end of the line.
Alternatively you may want to know that `s[:-1]` strips off the last character
of `s`.

