参考链接:
https://blog.csdn.net/weixin_36279318/article/details/79078255
需求:将a.csv中,相同手机号,只要有一个发送成功,则其余改为发送成功
代码:
# -*- coding: utf-8 -*-
# @Time : 2019/2/19 16:32
# @Author : guigle
# @File : excel_check.py
# @Software: PyCharm
import os
from collections import defaultdict
import csv
# 遍历软件运行的文件夹
path_dir = os.getcwd()
for root, dirs, files in os.walk(path_dir):
for file in files:
if file.endswith('.csv'):
f = open(file, encoding='gbk')
reader1 = csv.reader(f)
# 电话列
tel_col = [column[2] for column in reader1]