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