江西省程力&依维柯得意救护车轴距及相关信息
江西省程力&依维柯得意救护车轴距及相关信息江西省程力&依维柯得意救护车轴距是指依维柯底盘上由程力专...
程力专汽2025-08-27 23:52:550次
# -*- coding: utf-8 -*-
import os
import csv
import shutil
import time
def move_files_according_to_record():
current_directory = os.path.dirname(os.path.abspath(__file__))
move_directory = os.path.join(current_directory, "移动")
if not os.path.exists(move_directory):
os.mkdir(move_directory)
record_file_path = os.path.join(current_directory, "发布记录.csv")
moved_file_path = os.path.join(current_directory, "移动记录.csv")
# 读取已经移动的文件列表
moved_files = set()
if os.path.exists(moved_file_path):
with open(moved_file_path, "r", encoding="utf-8") as moved_file:
reader = csv.reader(moved_file)
for row in reader:
moved_files.add(row[0])
# 读取发布记录文件并移动文件
with open(record_file_path, "r", encoding="utf-8", newline='') as record_file:
reader = csv.reader(record_file)
for row in reader:
filename = row[0]
source_file_path = os.path.join(current_directory, filename)
destination_file_path = os.path.join(move_directory, filename)
if os.path.exists(source_file_path) and filename not in moved_files:
try:
shutil.move(source_file_path, destination_file_path)
print(f"已移动文件: {filename}")
# 记录移动成功的文件名
with open(moved_file_path, "a", encoding="utf-8", newline='') as moved_file:
writer = csv.writer(moved_file)
writer.writerow([filename])
except Exception as e:
print(f"移动文件{filename}时出现错误:{e}")
else:
print(f"未发现{filename},移动失败。")
if __name__ == "__main__":
move_files_according_to_record()
上一篇:滁州市军用方舱品牌排行榜前10名
下一篇:关键词,生成文章结果
1 程力重工总公司配件购买2025-11-28
2 程力牌汽车集团总公司官网联系方式2025-11-28
3 程力牌企业销售网点2025-11-28
4 程力制造厂外贸部官网联系方式2025-11-28
5 程力威专汽制造厂官网联系方式2025-11-28
6 程力生产厂家外贸部官方网站主页2025-11-28
7 老程力重工有限公司招标投标2025-11-28
8 老程力商用车造车有限公司服务热线2025-11-28
9 程力牌企业直销部销售网点2025-11-28
10 老程力特种车辆制造厂400电话2025-11-28

江西省程力&依维柯得意救护车轴距及相关信息江西省程力&依维柯得意救护车轴距是指依维柯底盘上由程力专...

阳泉市程力&依维柯得意救护车方式阳泉市程力&依维柯得意救护车方式指的是使用程力专用汽车股份有限公司...

海口市程力&依维柯得意救护车电源海口市程力&依维柯得意救护车电源是程力专用汽车股份有限公司以南京汽...

鞍山市程力&依维柯得意救护车评论近年来,鞍山市程力&依维柯得意救护车在中国医疗行业中备受关注。程力...

抚顺市程力&依维柯得意救护车一辆特价抚顺市程力&依维柯得意救护车一辆特价,您所需要的内容如下:车辆...