ConvertTo-Csv 输出不带引号 [英] ConvertTo-Csv Output without quotes

查看:31
本文介绍了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天全站免登陆