我有一个CSV文件,其内容需要转换为全部小写
我已尝试过以下代码,但不保留CSV结构。
(Get-Content C:\_Scratch\export.csv).ToLower() | Out-File C:\_scratch\export.csv
$Init = Import-Csv C:\_Scratch\export.csv
我可以尝试另一种选择吗?
答案 0 :(得分:3)
Get-Content
将为您提供字符串数组。添加-Raw
开关以将其作为单个字符串读取,并且.toupper()
和.tolower()
字符串方法应该适用于此。
(Get-Content C:\_Scratch\export.csv -Raw).ToLower() | Out-File C:\_scratch\export.csv
答案 1 :(得分:-1)
std::cout