netdzb 当前离线
上尉
xp3000 当前离线
少尉
//&cls&dir /b *.lrc|cscript -nologo -e:jscript "%~f0"&pause&exit function reStr(file){ var f = fso.opentextfile(file, 1); str = f.ReadAll() .replace(/^(\[[0-9]{2}:[0-9]{2}.[0-9]{2}\])([^\[]+)\r\n(\[[0-9]{2}:[0-9]{2}.[0-9]{2}\])/gm, '$1 ---> $3$2\r\n$3') .replace(/^(\[[0-9]{2}:[0-9]{2}.[0-9]{2}\])([^\[]+)\r\n(\[[0-9]{2}:[0-9]{2}.[0-9]{2}\])/gm, '$1 ---> $3$2\r\n$3') .replace(/^(\[[0-9]{2}:[0-9]{2}.[0-9]{2}\])([^\[>]+)(\r\n)*$/mg, '$1 ---> $2$3'); f.Close(); var f = fso.opentextfile(file, 2); f.Write(str); } var fso = new ActiveXObject('Scripting.FileSystemObject'); while(!WScript.StdIn.AtEndOfStream)reStr(WScript.StdIn.ReadLine());复制代码
TOP
newswan 当前离线
$file = "1.txt" $fc = Get-Content $file for ($i=0 ; $i -lt $t.count -1 ; $i++){ $fc[$i].Substring(0,10) + "--->" + $fc[$i+1].Substring(0,10) + " " + $fc[$i].Substring(10) } $fc[-1]复制代码
went 当前在线
少校
@echo off & cd /d "%~dp0" setlocal enabledelayedexpansion for %%i in (*.lrc) do ( ( cd.>"%%~ni.src" for /f "usebackq tokens=1* delims=[]" %%a in ("%%i") do ( if not "!lastTime!"=="" ( echo !lastTime! ---^> %%a ) set "lastTime=%%a" echo %%b >> "%%~ni.src" ) echo !lastTime! ---^> )>"%%~ni.time" echo done. %%i ) pause&exit复制代码
$fc = Get-Content "1.txt" for ($i=0 ; $i -lt $t.count -1 ; $i++){ $fc[$i] = $fc[$i].Substring(0,10) + " ---> " + $fc[$i+1].Substring(0,10) + " " + $fc[$i].Substring(10) } $tt = $fc[-1].Substring(1,8) $tt = [datetime]::ParseExact($tt, 'mm:ss.ff', $null).addseconds(2).tostring("mm:ss.ff") $tt = "[" + $tt + "]" $fc[-1] = $fc[-1].Substring(0,10) + " ---> " + $tt + " " + $fc[$i].Substring(10) $fc复制代码
qixiaobin0715 当前离线
大校
@echo off setlocal enabledelayedexpansion (for /f "tokens=1* delims=[]" %%a in (test.lrc) do ( if defined str1 ( set /a n+=1 echo,!n!&echo,!str1! ---^> %%a&echo,!str2!&echo, ) set "str1=%%a" set "str2=%%b" ) set /a n+=1 echo,!n!&echo,!str1! ---^> &echo,!str2!&echo, )>test.srt pause复制代码