首页 > 解决方案 > Powershell中插入符号(^)的转义字符

问题描述

我需要用制表符(“ t") in a CSV file in Powershell. I tried escaping caret with a backtick(^~`^)替换“^~^”,但它不起作用。我该怎么做?

$file=导入-Csv $dataFilePath

$file - 替换 " ^~^", "`t"

标签: regexpowershell

解决方案


那是你要找的吗?

 >$s = "^~^"
 >$s -replace "\^\~\^", "``t"
 `t

希望有帮助。


推荐阅读