Friday, 16 October 2009

replace a string in a file with another

replace string in a group of files and movr the original files to file.bkp to be safe.

perl -i.bak -wpl -e 's/include/exclude/g;' datasource-4*.xml


Option "p" is for automating printing of rest of the file along with the strings which are newly placed.

No comments:

Post a Comment

Tweets by @sriramperumalla