本帖最后由 smss 于 2019-7-12 12:36 编辑
- PowerShell "$s=[IO.File]::ReadAllText('8.xml', [Text.Encoding]::UTF8) -replace '(?<!<[^<>\s]+)\s+'; sc 8.xml $s -Enc UTF8"
复制代码 以<ContentProviderBinder为节点则不修改如下例子
<ContentProviderBinder name="missed_calls" uri="content://call_log/calls" columns="date,number,name,type,duration" order="date DESC" where="type=3 AND new=1" countName="call_count"/>
能用 感觉改的不太对- @echo off
- PowerShell "$str=[IO.File]::ReadAllText('a.xml',[Text.Encoding]::UTF8) -replace '<!--(?:(?!-->).)*-->'; $str=[regex]::Replace($str, '<(?!ContentProviderBinder\s)[^<>]*>', {param($m);$s=$m.Value;$s -replace '(?<!<[^<>\s]+)\s+'}); [IO.File]::WriteAllText('b.xml', $str, [Text.Encoding]::UTF8)"
- pause
复制代码
|