0
我已经看过这个问题在3岁的问题,但无法适应批处理脚本与我的情况下工作:Rename text files based on multiple strings in their contents重命名文本文件
这是我的文本文件包含:
<!-- ===============================================
TEXT TEXT"
===============================================
An : ONE
Ca : ONE - AVRIL 2016
Site : example.com -->
<!--===============================================
Insertion : example.com - Bannières Mobile 300X250 VF (300x250)
我想要重命名该订单Insertion :
包含的所有文件。在我的例子将是:example.com - Bannières Mobile 300X250 VF (300x250)
我试图用这个脚本,因为它使用的日期和时间,原来的问题,但我不知道如何使它工作
setlocal enabledelayedexpansion
REM for all files do:
for %%f in (*.txt) do (
REM get desired lines and set variables:
for /f "tokens=2,4 delims=:" %%i in (' findstr "^Insertion" %%f') do set %%i=%%j
REM construct filename:
set "name=!Insertion!.txt"
echo Filename is: "!name!"
)
可有人请帮我调整代码?
感谢您的帮助,第二个代码运行良好,唯一的一点是'example.com'中的'é' - BannièresMobile 300X250 VF(300x250)'显示出像这样的'Banni├¿res' 其他比一切都好,非常感谢你的帮助 – Penguin90x