Hi I’m completely new to Powershell so pardon me if this question has a really simple answer.
I would like to use Powershell to look thru a textfile, get all values and prefix and post fix these values with a character.
How can this be done?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To add a prefix and suffix to each line of a file (with default command aliases this would be a lot shorter, but full names are clearer):
Add
-encoding UTF8to theout-fileto override the default encoding (UTF-16).To do this in place
output-filewill need to be a temporary file and then replace theinput-fileafter the processing has completed or read the input file into memory.