我有一个名为file.txt的文本文件,
.File.txt 的图像 .txt 文件的组合图片
我正在运行以下代码,仅过滤来自上述文本文件 file.txt 的 mail:pass
@rem.^
Combo: [email protected]:password^
As Combo:^
[email protected]:ajfbdf^ **Unwanted Text with symbols, numbers or text , basically anything....**^
As Combo: [email protected]:password@1^ **Unwanted Text with symbols, numbers or text , basically anything....** ^
[email protected]:passypassyword123^
[email protected]:youtube123^
@echo off & type nul >.\mail.txt & for /f "tokens=*delims=" %%i in ('type combo.txt')do (
echo=%%~i|find "@">nul && for /f "tokens=01,02,03delims=:" %%I in ('call echo=%%~i')do (
echo=%%~I|find "@">nul && set "_m_p=%%I:%%J" || set "_m_p=%%~J:%%~K") && for /f %%E in ('
echo=%%~J')do cmd /v/c "echo=!_m_p: =!"|find "@")>>.\mail.txt ||>nul call nul 2>nul 2>&1
在 mail.txt 中获得输出 输出图像
mail.txt 中的预期输出,
[email protected]:ajfbdf
[email protected]:password@1
[email protected]:password
[email protected]:passypassyword123
[email protected]:youtube123
文本文件的每个文本行中的邮件 ID 和密码将不同。例如,上面给出的邮件 ID 和密码是随机的。
请任何人分享有助于获得预期输出的代码。我刚开始学习时对批处理非常不熟悉,所以我真的需要帮助。先感谢您。
获取每一行 (%%a) 并将其拆分为“单词”(
%%b
)。测试每个“单词”是否匹配所需的格式(包含
@
and:
)。如果匹配,
echo
它。最后,将输出重定向到结果文件。
试试这个代码,你必须将文本文件拖放到批处理文件中。它应该在原始文件的文件名中添加“邮件”。