@echo off ::Code by oicu#lsxk.org 2018-10-11, forcmd@Windows
typenul>c.txt SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "delims=" %%ain (b.txt) do ( echo.%%a | findstr /i "Track[0-9]" >NUL && ( set swap=%%a set swap=!swap:Track=! rem 因为截取方式不准确,还是使用替换,直到得到2位数字 set swap=!swap:TITLE=! set swap=!swap:"=! set swap=!swap: =! rem 搜索时,在行首搜索数字并带点,比如 01. FOR /F "tokens=1,2* delims=." %%iin ('type a.txt^| findstr /i "^^!swap!\."') do ( rem 根据实际情况调整缩进的空格 echo. TITLE "%%j">>c.txt ) ) || ( echo.%%a>>c.txt ) ) ENDLOCAL goto :eof
REM DISCID 8308500A REM COMMENT "ExactAudioCopy v0.99pb5" PERFORMER "龙飘飘" TITLE "最好的龙飘飘CD2" FILE "CDImage2.wav" WAVE TRACK 01 AUDIO TITLE "Track01" PERFORMER "龙飘飘" INDEX 01 00:00:00 TRACK 02 AUDIO TITLE "Track02" PERFORMER "龙飘飘" INDEX 01 03:55:10 TRACK 03 AUDIO TITLE "Track03" PERFORMER "龙飘飘" INDEX 01 08:14:13 TRACK 04 AUDIO TITLE "Track04" PERFORMER "龙飘飘" INDEX 01 11:41:03 TRACK 05 AUDIO TITLE "Track05" PERFORMER "龙飘飘" INDEX 01 14:25:74 TRACK 06 AUDIO TITLE "Track06" PERFORMER "龙飘飘" INDEX 01 18:40:71 TRACK 07 AUDIO TITLE "Track07" PERFORMER "龙飘飘" INDEX 01 22:22:41 TRACK 08 AUDIO TITLE "Track08" PERFORMER "龙飘飘" INDEX 01 25:55:18 TRACK 09 AUDIO TITLE "Track09" PERFORMER "龙飘飘" INDEX 01 28:47:45 TRACK 10 AUDIO TITLE "Track10" PERFORMER "龙飘飘" INDEX 01 31:49:61
REM DISCID 8308500A REM COMMENT "ExactAudioCopy v0.99pb5" PERFORMER "龙飘飘" TITLE "最好的龙飘飘CD2" FILE "CDImage2.wav" WAVE TRACK 01 AUDIO TITLE "成长的岁月" PERFORMER "龙飘飘" INDEX 01 00:00:00 TRACK 02 AUDIO TITLE "流不完的泪" PERFORMER "龙飘飘" INDEX 01 03:55:10 TRACK 03 AUDIO TITLE "愿你莫忘记" PERFORMER "龙飘飘" INDEX 01 08:14:13 TRACK 04 AUDIO TITLE "飘往山那边" PERFORMER "龙飘飘" INDEX 01 11:41:03 TRACK 05 AUDIO TITLE "岁月的歌" PERFORMER "龙飘飘" INDEX 01 14:25:74 TRACK 06 AUDIO TITLE "应该不应该" PERFORMER "龙飘飘" INDEX 01 18:40:71 TRACK 07 AUDIO TITLE "分手" PERFORMER "龙飘飘" INDEX 01 22:22:41 TRACK 08 AUDIO TITLE "梦儿难忘记" PERFORMER "龙飘飘" INDEX 01 25:55:18 TRACK 09 AUDIO TITLE "请你别忘记" PERFORMER "龙飘飘" INDEX 01 28:47:45 TRACK 10 AUDIO TITLE "舞女" PERFORMER "龙飘飘" INDEX 01 31:49:61