Powershell replace a specific text into specific line in file.txt

Viewed 33

I have a question.

Into the file test.txt I need replace some data in different line.

Example: this the file

hello to you
the ddd is you
blablabla is you
force you

in the line 1 and 3 I need change "you" with "me"

in the script I create a variable

$change = get-content -path test.txt

and

$change[1] is "hello to you" 

now I need change only "you" and the results I need is "hello to me"

0 Answers
Related