27 lines
787 B
Python
27 lines
787 B
Python
import csv
|
|
|
|
EXCEL_PATH = r'd:\Cheney\geely-kaipiao\doc\2025-2026团队结算进度.csv'
|
|
|
|
|
|
def read_team_column() -> list:
|
|
team_list = []
|
|
try:
|
|
with open(EXCEL_PATH, 'r', encoding='utf-8-sig') as f:
|
|
reader = csv.DictReader(f)
|
|
for row in reader:
|
|
team_value = row.get('团号', '')
|
|
if team_value and isinstance(team_value, str) and team_value.lower().startswith('team'):
|
|
team_list.append(team_value)
|
|
return team_list
|
|
except FileNotFoundError:
|
|
print(f"错误:文件 {EXCEL_PATH} 未找到")
|
|
return []
|
|
except Exception as e:
|
|
print(f"读取文件时出错: {e}")
|
|
return []
|
|
|
|
|
|
if __name__ == '__main__':
|
|
result = read_team_column()
|
|
print(result)
|