当前位置:网站首页>Modify the video name from the name mapping relationship in the table
Modify the video name from the name mapping relationship in the table
2022-07-06 08:24:00 【Don't seek great wealth, just seek wealth to rival the country】
subject :
There is one voiceFile In the folder 50 The suffix is *.pcm The file name needs to be modified , The file suffix is reserved , Modified name reference :rename.csv The innuendo in , The first column is the original name of the document , The second column is the current name of the file , Every line has an innuendo ( First row of old names , The second column is the corresponding new name ), It is required to change the file name of the folder to B Column name
resolvent :
import os
import pandas as pd
from log_utils import Log_util
# csv File path
csv_path=r"C:\Users\xdjiang6\Desktop\rename.csv"
# Video folder path
video_path=r"D:\xdjiang\voiceFile"
# Read csv file
res=pd.read_csv(csv_path)
# The first column is the original name of the document ( Old name )
old_list=res.values[:,0]
# The second column is the current name of the file ( Corresponding new name )
new_list=res.values[:,1]
# Combine the read new name with the old name into a dictionary
name_list=dict(zip(old_list,new_list))
# Read all video files in the video folder
aaa=os.listdir(video_path)
# Determine whether the video file name ==csv Extracted old file name , If equal , Change the video file name to the new file name
for i in aaa:
if i in name_list.keys():
os.rename(os.path.join(video_path,i),os.path.join(video_path,name_list[i]))
Log_util.mlog.debug(f"{
i}: The video name has been modified !")
else:
Log_util.mlog.error(f"{
i}: Not in the table , Please check !")
边栏推荐
- Fibonacci sequence
- Grayscale upgrade tidb operator
- Wincc7.5 download and installation tutorial (win10 system)
- [research materials] 2021 live broadcast annual data report of e-commerce - Download attached
- [Yugong series] February 2022 U3D full stack class 010 prefabricated parts
- Asia Pacific Financial Media | "APEC industry +" Western Silicon Valley invests 2trillion yuan in Chengdu Chongqing economic circle to catch up with Shanghai | stable strategy industry fund observatio
- [Yugong series] February 2022 U3D full stack class 011 unity section 1 mind map
- Asia Pacific Financial Media | designer universe | Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers
- National economic information center "APEC industry +": economic data released at the night of the Spring Festival | observation of stable strategy industry fund
- Restore backup data on S3 compatible storage with tidb lightning
猜你喜欢

"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa

A Closer Look at How Fine-tuning Changes BERT

Asia Pacific Financial Media | "APEC industry +" Western Silicon Valley invests 2trillion yuan in Chengdu Chongqing economic circle to catch up with Shanghai | stable strategy industry fund observatio

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower

将 NFT 设置为 ENS 个人资料头像的分步指南

Analysis of pointer and array written test questions

C language custom type: struct

C language - bit segment
![[research materials] 2022 enterprise wechat Ecosystem Research Report - Download attached](/img/35/898a8086bc35462b0fcb9e6b58b86b.jpg)
[research materials] 2022 enterprise wechat Ecosystem Research Report - Download attached

【刷题】牛客网面试必刷TOP101
随机推荐
VMware virtualization cluster
Migrate data from SQL files to tidb
2. File operation - write
NFT smart contract release, blind box, public offering technology practice -- jigsaw puzzle
CAD ARX gets the current viewport settings
远程存储访问授权
[t31zl intelligent video application processor data]
LDAP application (4) Jenkins access
Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
Leetcode question brushing record | 203_ Remove linked list elements
C语言自定义类型:结构体
灰度升级 TiDB Operator
使用 TiDB Lightning 恢复 S3 兼容存储上的备份数据
Use dumping to back up tidb cluster data to S3 compatible storage
2022.02.13 - NC004. Print number of loops
[research materials] 2021 China online high growth white paper - Download attached
LDAP Application Section (4) Jenkins Access
好用的TCP-UDP_debug工具下载和使用
hcip--mpls
根据csv文件某一列字符串中某个数字排序