Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 将下载地址从多个txt文件提取到新的txt文件的批处理_Batch File_Command_Findstr - Fatal编程技术网

Batch file 将下载地址从多个txt文件提取到新的txt文件的批处理

Batch file 将下载地址从多个txt文件提取到新的txt文件的批处理,batch-file,command,findstr,Batch File,Command,Findstr,我有很多txt文件,其中包含以下文字,下载和地址 我只想要1fichier网站的下载地址,所以我写了一批,如下所示: set pa="C:\download" for /r %pa% %%a in (*.txt) do type %%~fa|Findstr "hxxps://1fichier.com/" >> getdownload.txt getdownload.txt结果: h53tnzhh0514dsvr00700.xjl5xtqg.part1.rar : hxxps://1

我有很多txt文件,其中包含以下文字,
下载
地址

我只想要
1fichier
网站的下载地址,所以我写了一批,如下所示:

set pa="C:\download"
for /r %pa% %%a in (*.txt) do type %%~fa|Findstr "hxxps://1fichier.com/" >> getdownload.txt
getdownload.txt结果:

h53tnzhh0514dsvr00700.xjl5xtqg.part1.rar : hxxps://1fichier.com/?oesuw9ty9lkhh2wbj5us
h53tnzhh0514dsvr00700.xjl5xtqg.part2.rar : hxxps://1fichier.com/?exgrcaza0i2cjmwpyvpb
我只想要
hxxps://1fichier.com/?oesuw9ty9lkhh2wbj5us
hxxps://1fichier.com/?exgrcaza0i2cjmwpyvpb
, 不是文件名,
h53tnzhh0514dsvr00700.xjl5xtqg.part1.rar:
h53tnzhh0514dsvr00700.xjl5xtqg.part2.rar:
零件

如何获得以下结果:

hxxps://1fichier.com/?oesuw9ty9lkhh2wbj5us
hxxps://1fichier.com/?exgrcaza0i2cjmwpyvpb
我有大约20个txt文件,其中包含以下内容

115 download address: 

ed2k://|file|h53tnzhh0514dsvr00700.xjl5xtqg.part1.rar|12884901888|2B958C84EF5C4BDE5B1031DC9ACAAE7C|h=NFRHBEWYTMQNYAQ3FVHEU5UFEJ2CMZ44|/
ed2k://|file|h53tnzhh0514dsvr00700.xjl5xtqg.part2.rar|1135932776|87EF320F80F201AB66B19E23D9AA999F|h=X3MKSWI7ZLBKOJDXBC3CKJVSALEGSO7S|/


1fichier download address:

h53tnzhh0514dsvr00700.xjl5xtqg.part1.rar : hxxps://1fichier.com/?oesuw9ty9lkhh2wbj5us

h53tnzhh0514dsvr00700.xjl5xtqg.part2.rar : hxxps://1fichier.com/?exgrcaza0i2cjmwpyvpb

对我来说,最简单、最有效的方法是直接使用
FindStr

@Echo Off&SetLocal EnableExtensions
设置“pa=C:\下载”
(对于/F“令牌=2*”%%G In(
“%\uuuu AppDir\uuuu%findstr.exe/SIL”hxxps://1fichier.com/“%pa%\*.txt”2^>NUL”
)执行@If“%%G”==”:“Echo(%%H)>“getdownload.txt”

查看(…)中/f“tokens=3”%%a的…
谢谢您的反馈,请您查看一下,了解下一步和下一步应该做什么。