回复 4# 5i365 - $a=@{}
- $f=[io.file]::ReadAllLines('.\a.csv')
- $f|%{
- $z=$_ -replace '^(\d+).*','$1'
- if (!($a.ContainsKey($z))){$a.$z=$_}
- }
- $b=@{}
- dir -recu * -inc *歌手*.txt,*歌名*.txt,*歌曲*.txt|%{
- foreach($i in [io.file]::ReadAllLines($_) -match '\d+'){
- $z=$i -replace '\D*(\d+)\D*','$1'
- if(!($b.ContainsKey($z))){$b.$z=$a.$z}
- }
- }
- sc b.csv ($f[0],($b.Values|sort{[int]($_ -replace '^(\d+)\D*','$1')}))
复制代码
|