16.2. Replace file content

 
You have a bunch of text files in your directory mentioning the name:
   
"Microsoft Word"

You are told to replace that by 
    
"OpenOffice Write"

perl -i -p -e "s/Microsoft Word/OpenOffice Write/g" *.txt

-i = inplace editing
-p = loop over lines and print each line (after processing)
-e = command line script


If you are interested in on-site trainings by the author, please contact me directly.

Online courses:

Would you like to get
updated when I publish
the next article?

Follow me:

Google Plus Twitter RSS feed