Batch file 如何使用批处理修复此(筛选程序)?

Batch file 如何使用批处理修复此(筛选程序)?,batch-file,cmd,Batch File,Cmd,我有一个名为file.txt的文本文件,其中包含, Combo: testing123mail@gmail.com:password As Combo: abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf some text here some more text here As Combo: hadvsfhia@ahfjbadj.com:password@1 some random text here iloveu@gmail.com:passypassy

我有一个名为
file.txt的文本文件,其中包含,

Combo: testing123mail@gmail.com:password
As Combo: 
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
some text here
some more text here
As Combo: hadvsfhia@ahfjbadj.com:password@1
some random text here
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
hadvsfhia@ahfjbadj.com:password@1
testing123mail@gmail.com:password
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
hadvsfhia@ahfjbadj.com:password@1
testing123mail@gmail.com:password
Combo:
Combo:
Combo:
As
As
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123
我正在运行下面的代码,只过滤上面文本文件
file.txt中的
mail:pass

for /f "tokens=3" %%a in ('type file.txt^|find "As Combo:"') do >>mail.txt echo %%a
for /f "tokens=2" %%b in ('type file.txt^|find "Combo:"') do >>mail.txt echo %%b
for /f "tokens=1" %%c in ('type file.txt^|find ":"') do >>mail.txt echo %%c
邮件.txt中的预期输出

Combo: testing123mail@gmail.com:password
As Combo: 
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
some text here
some more text here
As Combo: hadvsfhia@ahfjbadj.com:password@1
some random text here
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
hadvsfhia@ahfjbadj.com:password@1
testing123mail@gmail.com:password
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
hadvsfhia@ahfjbadj.com:password@1
testing123mail@gmail.com:password
Combo:
Combo:
Combo:
As
As
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123
但是,我得到的实际输出是,

Combo: testing123mail@gmail.com:password
As Combo: 
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
some text here
some more text here
As Combo: hadvsfhia@ahfjbadj.com:password@1
some random text here
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
hadvsfhia@ahfjbadj.com:password@1
testing123mail@gmail.com:password
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123
abcdefghijklmnopqrstuvwxyz@gmail.com:ajfbdf
hadvsfhia@ahfjbadj.com:password@1
testing123mail@gmail.com:password
Combo:
Combo:
Combo:
As
As
iloveu@gmail.com:passypassyword123
goldenmammy@hotmail.com:youtube123

注意:邮件id和密码在不同的文本文件中会有所不同。例如,上面给定的邮件id和密码是我随机键入的。

我建议您使用vbscript中的正则表达式来提取此类数据。下面是一个示例,向您展示如何提取此类数据,因此,如果您希望我将在vbscript中为您发布解决方案,只需回答您的问题并添加标签vbscript!为什么不为
@
添加find,并在提取包含它的所有电子邮件地址时查看它们呢。