Have a list of 200 or so files in a folder. Each has the same amount of columns but there can be some variation in the naming. For instance, i can have Global ID or Global id or Global Id. Is there a way to control for case in pandas column names so that it doesnt matter what it equals? Currently it will get through the first 15 or so files out of 200 and will error because it doesnt find Global ID.
Caveat that im a beginner and still learning.
import pandas as pd
import glob
with open('test99.txt' , 'a') as out:
list_of_files = glob.glob('M:\AD HOC Docs\Client\Blinded\*')
for file_name in list_of_files:
df = pd.read_table(file_name, low_memory=False)
df['Client'] = file_name.split("_")[2].strip()
Final = df[['Client','ClientID','Global ID','Internal ID','campaign type','engagement type', 'file_name']]
Final.to_csv(out,index=False)