Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Search and Replace CRLF

$
0
0

Get-Content returns an array of strings, by default, and those strings will not include the actual CR/LF characters that were present in the file. All you need to do is use the -join operator to combine the array back into a single comma-separated string:

$String = (Get-Content e:\powershell\file.txt) -join ','

Viewing all articles
Browse latest Browse all 13067