with open(my_file_name, 'r', newline='') as infile:
    with open(cleaned_file, 'w', newline='') as outfile:
        writer = csv.writer(outfile)
for line in csv.reader(infile, delimiter='|'):
    if not any(remove_word in element for element in line for remove_word in
        remove_words):
        line[1] = line[1][:6]
writer.writerow(line)
Reformat a column to only first 5 characters