I am new to PowerShell. I'd like to add double quotation and OR, e.g.,"word" OR, for each line in a text file and output the results in a new file. I got this so far: %{" "$_ " OR "} but of course it's giving me the following error: Unexpected token.
1 Answer
Nested double quotes must be escaped (escape character in PowerShell is the backtick):
% { "`"$_`" OR" }
5 Comments
c0ldhand
Thank you. Now how do you get rid of the white space at the end of each line?.
Ansgar Wiechers
Trim it.
c0ldhand
The actual file has white space at the end of each string, how do you get ride of it using PowerShell?. Thanks in advance.
Ansgar Wiechers
I already told you. For further advice please post a new question. Make sure you include sample input and output.
c0ldhand
I got it! Thanks again.