无引号的ConvertTo-Csv输出 [英] ConvertTo-Csv Output without quotes

查看:33
本文介绍了无引号的ConvertTo-Csv输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ConvertTo-Csv 获得逗号分隔的输出

I am using ConvertTo-Csv to get comma separated output

get-process | convertto-csv -NoTypeInformation -Delimiter ","

输出类似:

"__NounName","Name","Handles","VM","WS",".....

但是我想获得不带引号的输出,例如

However I would like to get output without quotes, like

__NounName,Name,Handles,VM,WS....

推荐答案

这是删除引号的一种方法

Here is a way to remove the quotes

get-process | convertto-csv -NoTypeInformation -Delimiter "," | % {$_ -replace '"',''} 

但是如果其中一项包含"将会被删除,则有一个严重的缺点!

But it has a serious drawback if one of the item contains a " it will be removed !

这篇关于无引号的ConvertTo-Csv输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆