返回列表 发帖
回复 3# s091200


  
@echo off
cd /d "%~dp0"
set /p str=<"1.txt"
(for /f "useback skip=1 delims=" %%i in ("1.txt") do (
set _str=%%i
setlocal enabledelayedexpansion
echo !_str:^&=%str%^&!
endlocal
)) > "2.txt"
pauseCOPY
bat小白,请多指教!谢谢!

TOP

回复 6# s091200

@echo off
cd /d "%~dp0"
for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
call :1 "%%i"
)
pause
exit
:1
set /p str=<"%~1"
(for /f "useback skip=1 delims=" %%i in ("%~1") do (
set _str=%%i
setlocal enabledelayedexpansion
echo !_str:^&=%str%^&!
endlocal
)) > "%~n1_2%~x1"
rem move "%~n1_2%~x1" "%~1"
exit /bCOPY
bat小白,请多指教!谢谢!

TOP

回复 11# s091200


  
@echo off
cd /d "%~dp0"
for /f "delims=" %%i in ('dir /b /s /a-d *.txt') do (
call :1 "%%i"
)
pause
exit
:1
set /p str=<"%~1"
(for /f "useback skip=1 delims=" %%i in ("%~1") do (
set _str=%%i
setlocal enabledelayedexpansion
echo !_str:^&=%str%^&!
endlocal
)) > "%~dpn1_2%~x1"
rem move "%~dpn1_2%~x1" "%~1"
exit /bCOPY
1

评分人数

bat小白,请多指教!谢谢!

TOP

返回列表