test.ps1- $Hash = @{};
-
- type a.txt | ?{$_ -match '点击进入下载-(.*)\(1\)\.torrent'} | %{
- $key = $matches[1] -replace '[ ()]', '_';
- $Hash[$key] = $_;
- }
-
- type b.txt | group{ $_ -replace '.*?/([^/]*)_\d+_\.jpg\].*$', '$1' } | %{
- $_.Group;
- $Hash[$_.Name];
- } > c.txt
复制代码
|