[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. #@&cls&powershell "type %~s0|out-string|iex"&exit
  2. $a=gc -readcount 0 D:\UTF16.txt
  3. $b=(($a[-1..-500] -match '企业 ')[0] -split ' ')[5,6] -jion '|'
  4. $f=0
  5. sc D:\out.txt $(foreach($i in $a){if(($f -eq 0) -and $i -match "简名:.*?($b)"){$i;$f=1}elseif(($f -eq 1) -and $i -match '已执行'){$f=0;$i,''}elseif($f -eq 1){$i}})
复制代码

TOP

错了是-join

TOP

  1. #@&cls&powershell "type %~s0|out-string|iex"&exit
  2. $a=gc -readcount 0 UFT16.txt
  3. $b=(($a[-1..-500] -match '企业 ')[0] -split ' ')[6,7] -join ' '
  4. $f=0
  5. sc out.txt $(foreach($i in $a){if(($f -eq 0) -and $i -match ".*$([regex]::escape($b))"){$i;$f=1}elseif(($f -eq 1) -and $i -match '已执行'){$f=0;$i,''}elseif($f -eq 1){$i}})
  6. start out.txt
复制代码

TOP

返回列表