I'm trying to edit a large plain text document containing various html elements such as the following:
<p> & </p><script> & </script><style> & </style><div> & </div>- And in more extreme cases;
<span style="color: #ff0000;"> & </span>
My goal is to remove any <UniqueText> from a text file. I've not worked with powershell much so my knowledge is limited, none less, I gave it a shot.
For replacing all <UniqueText>
get-content "C:\Users\John\Desktop\input.txt" | -replace "\<.*?\>","" | Out-File C:\Users\John\Desktop\output.txt
The above script gives the following error:
-replace : The term '-replace' is not recognized as the name of a cmdlet, function, script file, or operable program.
... | % {$_ -replace "\<.*?\>",""} | ...instead.(Get-Content FILE) -replace '\<.*?\>'