change string in txt file
Is it possible using a batch script to change string in a txt file?
For example, I have status.txt
, which contai开发者_开发百科ns 2 lines:
SingleSite integer1
MultiSite integer2
I want to change them into:
TAG integer1
Engineer integer2
so SingleSite
becomes TAG
and MultiSite
becomes Engineer
sed -e "s/SingleSite/TAG/g" status.txt > new.status.txt
using one of the ports of sed mentioned in the article in Helen's comment.
精彩评论