Your site has been a big help for all of my batch files needs but i cannot find anything regarding the above subject. I have around 100 files in 1 folder that has a generic name and all has to be renamed according to its contents and can be found at line 27. I found the blow code but only gets from the first line; @echo off
cls
setlocal enabledelayedexpansionpushd g:\test\||echo Pushd failed - job terminated&& exit/b
for /f "tokens=*" %%1 in ('dir /b *.txt') do (
set /p inline=<%%1&set inline=!inline:~5,20!echo %%1 will be renamed !inline!.txt
ren %%1 !inline!.txt
)
how can i modify this so that it will get it from line 27.Thank you in advance.
@echo off & setlocal cls pushd G:\test || (echo.Pushd failed - job terminated & exit/B) for %%i in (*.txt) do call :REN %%i ren *.tmp *.txt exit /B :REN for /F "skip=26 tokens=*" %%j in ('type "%*"') do (set inline=%%j & goto :DONE) :DONE set inline=%inline:~5,20% echo.%* will be renamed %inline%.txt ren "%*" "%inline%.tmp" exit /B
Hey, great, works like a charm. Thank you very much for the fast reply IVO
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |