回复 1# a574045075 - @echo off
- set "OldFile=1.txt"
- set "NewFile=2.txt"
- (for /f "tokens=1* delims=:" %%a in ('findstr /n .* "%OldFile%"') do (
- if "%%b" == "" (
- echo,
- ) else (
- echo %%b | findstr /b "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] " >nul 2>nul
- if errorlevel 1 (
- echo,%%b
- ) else (
- echo 日期%%b
- )
- )
- ))>"%NewFile%"
复制代码
|