Member Avatar for RudyM

Hi all,

I would like to replace new lines with "<BR>" in a text file. I'm executing the following line in Powershell:

[regex]::Replace((Get-Content "testfile.txt"), "\.``n", ".<BR>", "Singleline")

The contents of testfile.txt:

Some text here for paragraph one.

More text for paragraph two.

Member Avatar for RudyM

Had to make it \r`\n` when in the powershell script. Stupid backtick issue in the format, but basically \r\n.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.