Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 使用导出csv时,我的特殊字符显示为?。是否可以批量删除特殊字符?_Powershell_Special Characters_Export Csv - Fatal编程技术网

Powershell 使用导出csv时,我的特殊字符显示为?。是否可以批量删除特殊字符?

Powershell 使用导出csv时,我的特殊字符显示为?。是否可以批量删除特殊字符?,powershell,special-characters,export-csv,Powershell,Special Characters,Export Csv,运行以下代码时: $folderPath = '\\dc1\shared\BI\HisRms\' $folderPathDest = 'C:\Users\jonathon.kindred\Desktop\RM2\' $Columns = 'SKU', 'Landed Cost', 'Current Std Price', 'Current Sale Price', 'Free Stock', 'Markdown', 'Published Calc' Get-ChildItem

运行以下代码时:

$folderPath = '\\dc1\shared\BI\HisRms\'

$folderPathDest = 'C:\Users\jonathon.kindred\Desktop\RM2\'


$Columns = 'SKU', 'Landed Cost',  'Current Std Price',  'Current Sale Price',  'Free Stock',  'Markdown',  'Published Calc'


Get-ChildItem $folderPath -Name |


ForEach-Object { 


    $filePath = $folderPath + $_


    $filePathdest = $folderPathDest + $_


    Import-Csv $filePath | Select $Columns |
    Export-Csv -Path $filePathDest
}
“落地成本”、“当前标准价格”、“当前销售价格”以开头结束?e、 g.?12.00


我只想在导出过程中删除这些列中的£符号,这样我就得到了十进制值。有人知道我会怎么做吗?

您可以批量删除特殊字符,如下所示:

$csv = Import-Csv $filePath | Select $Columns
$csv | Export-csv $FilePathDesc -Encoding Unicode

特殊字符是磅符号,编码是Unicode。

您可以批量删除特殊字符,如下所示:

$csv = Import-Csv $filePath | Select $Columns
$csv | Export-csv $FilePathDesc -Encoding Unicode

特殊字符是磅符号,编码是Unicode。

另外:当您在输出中看到
时,这意味着用于在终端上显示它的当前字符集无法识别它是Unicode。或者它有,但它没有特定字符的代码点。

另外:当您在输出中看到
时,这意味着用于在终端上显示它的当前字符集无法识别它是Unicode。或者它有,但它没有特定字符的代码点。

|导出Csv-Path$filePathDest-Encoding unicode|导出Csv-Path$filePathDest-Encoding unicode
这不起作用抱歉,它对我的数据执行以下操作:``SKU,“落地成本”,“当前标准价格”,“当前销售价格”,“免费库存”,“降价”,“已发布计算”S18W-1000023452-LRD�6.50","�20.00","�20.00、“86”、“否”、“发布”S17W-130003383-WTE�9.50","�25.00","�“S18W-2800023541-WTE”中的“第25.00条”、“第136条”、“第136条”、“第13条”和“已发布的”S18W-2800023541-WTE�7.25","�18.00","�18.00、“61”、“否”、“发布”S18W-2800023540-BCK�5.25","�18.00","�“18.00”、“68”、“否”、“发布”在ps 5中,导出csv的默认编码为ascii。抱歉,这不起作用,它对我的数据执行以下操作:``` SKU,“落地成本”,“当前标准价格”,“当前销售价格”,“免费库存”,“降价”,“发布计算”S18W-1000023452-LRD�6.50","�20.00","�20.00、“86”、“否”、“发布”S17W-130003383-WTE�9.50","�25.00","�“S18W-2800023541-WTE”中的“第25.00条”、“第136条”、“第136条”、“第13条”和“已发布的”S18W-2800023541-WTE�7.25","�18.00","�18.00、“61”、“否”、“发布”S18W-2800023540-BCK�5.25","�18.00","�18.00、“68”、“否”、“已发布”在ps 5中,导出csv的默认编码为ascii。