Wednesday, March 07, 2012

search and replace n occurrence with awk

awk '/Jack/{c++;if(c==2){sub("Jack","Rob");c=0}}1' file

No comments: