本帖最后由 qixiaobin0715 于 2023-11-20 14:05 编辑
这样也行:- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=2,3 delims=(), " %%i in (test.js) do (
- if "%%~xi"==".email" (
- set /a n+=1
- echo,邮箱地址!n!: %%~j
- ) else if "%%~xi"==".password" (
- echo,邮箱密码!n!: %%~j
- )
- )
- pause
复制代码 邮箱及密码在同一行显示:- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=2,3 delims=(), " %%i in (test.js) do (
- if "%%~xi"==".email" (
- set /a n+=1
- set "Email=邮箱!n!: %%~j"
- ) else if "%%~xi"==".password" (
- echo,!Email! 密码: %%~j
- )
- )
- pause
复制代码
|