#EXTINF:-1,5 канал Россия
http://95.189.57.162:1234/udp/233.7.70.6:5000
#EXTINF:-0,ТВ3
http://95.189.57.161:1234/udp/233.7.70.7:5000
#EXTINF:-1,ТНТ
rtmp://95.189.54.166:1234/udp/233.7.70.8:5000
#EXTINF:-2,Disney Channel
mms://95.189.52.146:1234/udp/233.7.70.9:5000
#EXTINF:-1,49 Канал
http://95.189.51.163:1234/udp/233.7.70.11:5000
以 #EXTINF:开头的行给出了电视频道的名称。频道是:
下一行是该频道的链接。
哪个命令或批处理脚本可以为列表的每个通道创建一个txt文件并放入相应的链接?对于这个例子:
http://95.189.57.162:1234/udp/233.7.70.6:5000
http://95.189.57.161:1234/udp/233.7.70.7:5000
rtmp://95.189.54.166:1234/udp/233.7.70.8:5000
mms://95.189.52.146:1234/udp/233.7.70.9:5000
http://95.189.51.163:1234/udp/233.7.70.11:5000
我真的很感激任何帮助! 非常感谢!
答案 0 :(得分:4)
试试这个:
@ECHO OFF &SETLOCAL ENABLEDELAYEDEXPANSION
FOR /f "tokens=2 delims=:" %%a IN ('chcp') DO SET /a CurrentCodePage=%%a 2>nul
CHCP 1251 >nul
FOR /f "tokens=1*delims=," %%a IN ('type file.txt') DO (
SET "link=%%a"
SET "channel=%%b"
IF DEFINED channel (SET "fname=!channel!"
) ELSE (ECHO !link!)>"!fname!.txt"
)
CHCP %currentCodePage% >nul
dir
输出与代码页850:
06/29/2013 08:38 AM 48 49 ?????.txt 06/29/2013 08:38 AM 47 5 ????? ??????.txt 06/29/2013 08:38 AM 46 Disney Channel.txt 06/29/2013 08:38 AM 47 ??3.txt 06/29/2013 08:38 AM 47 ???.txt
dir
输出的代码页为1251:
06/29/2013 08:38 AM 48 49 Канал.txt 06/29/2013 08:38 AM 47 5 канал Россия.txt 06/29/2013 08:38 AM 46 Disney Channel.txt 06/29/2013 08:38 AM 47 ТВ3.txt 06/29/2013 08:38 AM 47 ТНТ.txt
有关cmd和代码页的详细信息,请单击here。