本帖最后由 pcl_test 于 2018-4-26 07:26 编辑
- $srcfd='D:\A\';
- $desfd='D:\B\';
- if(-not (test-path -LiteralPath $desfd)){[void](md $desfd)}
- dir -LiteralPath $srcfd *.txt|%{
- $txt=gc -LiteralPath $_.FullName;
- $txt=($txt[1..($txt[$txt.length-1)]) -join "`r`n";
- out-file -InputObject $txt -FilePath ($desfd.TrimEnd('\')+'\'+$_.Name) -Encoding Default
- }
复制代码
|