I need to replace ^~^
with a tab (\t
) in a CSV file in PowerShell.
I tried escaping caret with a backtick (`^~`^
) but it doesn't work. How do I do this?
$file=Import-Csv $dataFilePath
$file -replace "\`^~\`^", "\`t"
I need to replace ^~^
with a tab (\t
) in a CSV file in PowerShell.
I tried escaping caret with a backtick (`^~`^
) but it doesn't work. How do I do this?
$file=Import-Csv $dataFilePath
$file -replace "\`^~\`^", "\`t"
Is that what you're looking for?
>$s = "^~^"
>$s -replace "\^\~\^", "``t"
`t
Hope that helps.