本帖最后由 idwma 于 2022-1-14 22:43 编辑
- #@&cls&powershell "type %~s0|out-string|iex"&pause&exit
- $in='test.txt'
- $out='out.txt'
- $a="$((gc $in -readcount 0) -match '企业|执行时间')" -split '.(?=企业)'
- $b=($a[-1] -split '\s+')[2]
- foreach($i in $($a -match $b -match '执行时间' -replace '.*>\s+|[hms]' -replace '^([^:]*?):([^:]*?)$','0:$1:$2')){$c+=[timespan]$i}
- sc $out ("$b > {0}h:{1:mm\m:ss\s}" -f ($c.days*24+$c.Hours),[datetime]$c.ticks)
复制代码
|