回复 3# 5i365 - #@&cls&powershell "type '%~0'|out-string|iex"&pause&exit
- $a=new-object -com excel.application
- $f=$env:tmp+'\tmp.csv'
- $n='张三'
- dir *.xlsx|%{
- $b=$a.workbooks.open($_.fullname).sheets.item(1)
- $b.saveas($f,6)
- $b.close()
- ipcsv $f -header 'a2','b2','c2','d2','e2'|?{$_.'a2' -eq $n}|%{
- $b2+=$_.'b2'
- $c2+=$_.'c2'
- $d2+=$_.'d2'
- $e2+=$_.'e2'
- }
- del $f
- }
- $a.quit()
- '{0},{1},{2},{3}' -f $b2,$c2,$d2,$e2
复制代码
|