import csv
def read_file(file_path, file_type, **kwargs):
if file_type == 'txt':
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
for key in kwargs.keys():
if key not in content:
return False
return True
elif file_type == 'csv':
keyword_count = {key: 0 for key in kwargs.keys()}
with open(file_path, 'r', encoding='utf-8') as f:
reader = csv.reader(f)
for row in reader:
for key in kwargs.keys():
if key in ' '.join(row):
keyword_count[key] += 1
return keyword_count
else:
raise ValueError("Unsupported file type")