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

[文本处理] 批处理怎样提取关键字的行和行里面的字符串?

config nodes 'ELmqb2VQ'
  option address '167.88.182.251'
config nodes 'ua7p4EM8'
   option address '45.159.51.106'

怎么提取出这种格式 'ELmqb2VQ' '167.88.182.251'

回复 4# ppll2030

好像啥也不显示!
其实我的本来的文件是这样字的

config nodes '6M0yhiK7'
        option tls '1'
        option protocol 'vless'
        option tcp_guise 'none'
        option tlsflow 'xtls-rprx-vision'
        option port '26338'
        option re
        option add_mode '1'
        option type 'Xray'
        option timeout '60'
        option reality '1'
        option tls_allowInsecure '0'
        option tls_serverName 'www.amazon.com'
        option uuid
        option reality
        option address '45.159.50.156'
        option encryption 'none'
        option fingerprint 'ios'
        option add_from '导入'
        option transport 'tcp'

config nodes '3iZQevS1'
        option tls '1'
        option protocol 'vless'
        option tcp_guise 'none'
        option tlsflow 'xtls-rprx-vision'
        option port '647
        option add_mode '1'
        option type 'Xray'
        option timeout '60'
        option reality '1'
        option tls_allowInsecure '0'
        option tls_serverName 'www.cloudflare.com'
        option uuid
        option reality_pub
        option address '45.159.51.94'
        option encryption 'none'
        option fingerprint 'ios'
        option add_from '导入'
        option transport 'tcp'

config nodes 'U1NNbFG7'
        option tls '1'
        option protocol 'vless'
        option tcp_guise 'none'
        option tlsflow 'xtls-rprx-vision'
        option port '48792'
        option remarks
        option add_mode '1'
        option type 'Xray'
        option timeout '60'
        option reality '1'
        option tls_allowInsecure '0'
        option tls_serverName 'www.paypal.com'
        option uuid
        option reality_pub
        option address '167.88.182.73'
        option encryption 'none'
        option fingerprint 'ios'
        option add_from '导入'
        option transport 'tcp'

后面还有格式一样的我需要的是提取config nodes 后面'U1NNbFG7' 和optionaddress 后面  '167.88.182.73'然后输出成 'U1NNbFG7' '167.88.182.73'

TOP

回复 2# hfxiang


感谢这样子可以!

TOP

回复  senkiss

用第3方工具gawk(  )的实现方式如下:
hfxiang 发表于 2024-2-2 19:17


这样子就是我想要的

TOP

返回列表