Summary: Use Windows PowerShell to parse file delimiters in a file.
How can I use Windows PowerShell to break out lines in a text file that are delimited by “\\”? Here is the file content:
PS C:\> Get-Content C:\fso\AnEmptyFile.txt
This is content
\\mydata\\more stuff
\\addmydata\\addmore stuff\\evenmore
Use the –Delimiter parameter of the Get-Content cmdlet. Here is an example with the associated output:
PS C:\> Get-Content C:\fso\AnEmptyFile.txt -Delimiter \\
This is content
\\
mydata\\
more stuff
\\
addmydata\\
addmore stuff\\
evenmore