批量修改文件名
来源:互联网 发布:node v6.11.1 x64.msi 编辑:程序博客网 时间:2024/05/29 15:28
核心是 doc 中的 ren 命令
#include <cstdio>#include <cstdlib>#include <iostream>#include <fstream>#include <string>#include <algorithm>using namespace std;string int2string(int n, int bit){ string s; for(int i = 0; i < bit; i++) s.push_back(n % 10 + '0'), n /= 10; reverse(s.begin(), s.end()); return s;}void init(int &pos, int &len){ string s = "[HKG&X2][When_They_Cry][DVDRip][01][XviD_MP3][CRC32_1A58530A].sc.ass"; pos = s.find("01"); len = 2;}int main(){ system("dir /b >file_directory.txt"); fstream in; in.open("file_directory.txt"); int pos, len; init(pos, len); string s; while(in >> s) { if(s == "rename.cpp") continue; if(s == "rename.o") continue; if(s == "rename.exe") continue; if(s == "file_directory.txt") continue; // 判断是否要转换 if(s.find("sc") == -1) continue; // 进行转换 string op = "ren \""; op += s + "\" " + s.substr(pos, len) + ".ass"; system(op.c_str()); } in.close(); system("del file_directory.txt"); return 0;}
0 0
- 批量文件名修改
- 批量修改文件名
- 批量修改文件名
- 批量修改文件名
- 批量修改mp3文件名
- 批量修改文件名
- 批量修改文件名
- shell批量修改文件名
- Python批量修改文件名
- shell批量修改文件名
- 批量修改文件名
- 批量修改文件名
- JAVA批量修改文件名
- linux批量修改文件名
- php批量修改文件名
- shell 批量修改文件名
- 批量修改文件名
- python 批量修改文件名
- 第11章 WebSocket协议开发
- LeetCode学习篇二十五——Balanced Binary Tree
- Javascript: unterminated string literal 解决方法
- axis2系列之返回json数据
- html页面跳转传递参数
- 批量修改文件名
- 数据结构试验四 --图论
- Java多线程锁对象的改变
- JS唤醒Android APP(包括在外部浏览器和WebView)
- Java基础第一阶段——02_Java语言基础_关键字&变量&运算
- 最短路径——SPFA算法(蓝桥杯试题集)
- java基础-集合框架9 增强for循环
- 带外数据
- 算法学习-最大连续子数组