[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 【已解决】求助批处理在文件中查找并提取指定内容生成文本文件

本帖最后由 不知道是谁 于 2023-11-20 17:26 编辑

假设文本内容如下:
user_pref("app.load.messenger", true);
user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1698398230);
user_pref("app.update.lastUpdateTime.blocklist-background-update-timer", 1698398350);
user_pref("app.update.lastUpdateTime.search-engine-update-timer", 1698373978);
user_pref("app.update.lastUpdateTime.xpi-signature-verification", 1698398445);
user_pref("browser.cache.disk.capacity", 358400);
user_pref("browser.cache.disk.filesystem_reported", 1);
user_pref("browser.download.importedFromSqlite", true);
user_pref("calendar.list.sortOrder", "9068e928-44b0-47ef-9409-398c83841143 1bee8ac2-2872-439a-9227-8d3b729eaaf2");
user_pref("calendar.registry.1bee8ac2-2872-439a-9227-8d3b729eaaf2.cache.enabled", true);
user_pref("calendar.registry.1bee8ac2-2872-439a-9227-8d3b729eaaf2.calendar-main-in-composite", true);
user_pref("calendar.registry.1bee8ac2-2872-439a-9227-8d3b729eaaf2.color", "#a8c2e1");
user_pref("calendar.registry.1bee8ac2-2872-439a-9227-8d3b729eaaf2.email", "a@qq.com");
user_pref("calendar.registry.1bee8ac2-2872-439a-9227-8d3b729eaaf2.imip.identity.key", "id1");
user_pref("calendar.registry.1bee8ac2-2872-439a-9227-8d3b729eaaf2.name", "a@qq.com");
user_pref("calendar.registry.1bee8ac2-2872-439a-9227-8d3b729eaaf2.password", "a.123456");
user_pref("calendar.registry.9068e928-44b0-47ef-9409-398c83841143.email", "b@qq.com");
user_pref("calendar.registry.9068e928-44b0-47ef-9409-398c83841143.pop3.identity.key", "id2");
user_pref("calendar.registry.9068e928-44b0-47ef-9409-398c83841143.name", "b@qq.com");
user_pref("calendar.registry.9068e928-44b0-47ef-9409-398c83841143.password", "b.123456");
user_pref("calendar.registry.3ecdadd0-7b89-410f-9a27-1c3fff3fba9a.email", "c@qq.com");
user_pref("calendar.registry.3ecdadd0-7b89-410f-9a27-1c3fff3fba9a.pop3.identity.key", "id3");
user_pref("calendar.registry.3ecdadd0-7b89-410f-9a27-1c3fff3fba9a.name", "c@qq.com");
user_pref("calendar.registry.3ecdadd0-7b89-410f-9a27-1c3fff3fba9a.password", "c.123456");
******more

需要提取其中的email和password,并输出文本内容如下:
邮箱地址1:a@qq.com
邮箱密码1:a.123456
邮箱地址2:b@qq.com
邮箱密码2:b.123456
邮箱地址3:c@qq.com
邮箱密码3:c.123456

或者
邮箱1:a@qq.com 密码:a.123456
邮箱2:b@qq.com 密码:b.123456
邮箱3:c@qq.com 密码:c.123456

命令希望尽量简练些,比如不带文字描述的命令
  1. for /f tokens^=4^ delims^=^" %%i in ('findstr "c.*\.email c.*\.password" "test.js"') do echo %%i
复制代码
1

评分人数

    • Batcher: 感谢给帖子标题标注[已解决]字样PB + 2

返回列表