- param([strinG]$file); #修改前的文件
- $file1 = [io.fileinfo]$file;
- $file2 = ".\2.txt";
- $UTF8NoBom = New-Object System.Text.UTF8Encoding $false;
- $str = [IO.File]::ReadAllText($file, [Text.Encoding]::Default);
- $str = $str -replace ' Mobile / Max-Q','Max-Q' -replace 'Mobile / ' -replace '\r\n', "`n";
- [IO.File]::WriteAllText($file2, $str, $UTF8NoBom);
复制代码
|