本帖最后由 路过 于 2021-1-12 14:59 编辑
回复 10# toyerspollors
歌手1的代码- @echo off
- setlocal enabledelayedexpansion
- pushd "%~sdp0"
- for /f %%a in ('findstr /v "^^^$" "歌手1.txt" ^| find /c /v ""') do set line=%%a
- (
- for /l %%a in (1,1,%line%) do (set "q="
- set /p q=
- if "!q!"=="" (echo;) else (
- set w=!q:~0,1!
- if "!w!"=="第" (echo;@@!q!) else (echo;!q!)
- )
- )
- )<歌手1.txt>n歌手1.txt
- pause
复制代码 歌手2的代码- @echo off
- setlocal enabledelayedexpansion
- pushd "%~sdp0"
- for %%a in (一 二 三 四 五 六 七 八 九) do (set .%%a=1)
- for /f %%a in ('findstr /v "^^^$" "歌手2.txt" ^| find /c /v ""') do set line=%%a
- (
- for /l %%a in (1,1,%line%) do (set "q="
- set /p q=
- if "!q!"=="" (echo;) else (
- set w=!q:~0,1!
- if defined .!w! (echo;@@!q!) else (echo;!q!)
- )
- )
- )<歌手2.txt>n歌手2.txt
- pause
复制代码
|