我试图创建一个批处理脚本来创建多个 m3u8 清单文件。这是我尝试做的一些伪代码
for (int i= 0; i < numberOfFiles; i++)
{
write preset lines to file.
for (int x = i x < i+10; x++)
{
write string + x in line to file
}
write end of file line to file
}
这就是我到目前为止所拥有的。我遇到了内部 for 循环的问题。我怎样才能让它从 x 运行到 x + 10?
@echo on
setlocal enabledelayedexpansion
set x=0
for /L %%x IN (0,1,5) do (
set file="index%%x.m3u8"
@echo #EXTM3U>>!file!
@echo #EXT-X-TARGETDURATION:10>>!file!
@echo #EXT-X-VERSION:3>>!file!
@echo #EXT-X-MEDIA-SEQUENCE:0>>!file!
@echo #EXT-X-PLAYLIST-TYPE:VOD>>!file!
set n=%x%
for /L %%n IN (n, 1, %x%+10) do (
@echo #EXTINF:10.00000,>>!file!
@echo fileSequence!n!.ts>>!file!
)
@echo #EXT-X-ENDLIST>>!file!
)