根据文件内容批处理文件重命名文件 [英] Rename file based on file Content batch file

查看:138
本文介绍了根据文件内容批处理文件重命名文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个批处理文件,读取该文件xyz.txt将该描述名称present和基于描述名称重命名文件名。

I need a batch file that reads the description name present in the XYZ.txt file and rename that file name based on description name.

例如,我有所谓的nest.txt的文件名,当我们打开文本文件(nest.txt)的文件名的第二行有描述(description =人),那么这个批处理文件应该重命名我的XYZ .txt文件作为Man.txt

For example i have a file name called "nest.txt" and when we open the text file(nest.txt) the second line of the file name has Description(Description=Man) then the batch file should rename my XYZ.txt file as Man.txt

我有1000个文件,根据上述条件进行重命名。请帮我

i have 1000 files to rename based on the above condition. Please help me

推荐答案

试试这个:

for /f "skip=1 tokens=1* delims==" %%i in (nest.txt) do ren XYZ.txt "%%~j.txt"

这篇关于根据文件内容批处理文件重命名文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆