我试图删除?字符和像素在一个唯一的列中输出文本文件。删除字符串不同部分中的唯一字符
样品字符串:300 dpi的
@{N='Dpi' ; E={$_.'Horizontal resolution'.Split(" ")[0]}}
我使用拆分成功删除dpi
虽然我也想在字符串的开始删除?
。
"Name","Path","BaseName","Dpi","Width(Pixels)","Height(Pixels)","DpiTest" "test.png","\\directory\TCG\Labels\test.png","test","?300","?2623","?1229","?2623 pixels"
如果你知道你有一个?并在您的字符串中的dpi只是使用替换... '$ string -replace'?',''' – nkasco
@nkasco使用'@ {N ='TEST'; E = {$ _。Width -replace'?',''}}'仍然返回?300 – Carlos