Browsing all articles tagged with lines
Jan
4

Using Perl to Replace Text in Multiple Files

You can search and replace text inside multiple files using Perl. This is how you do it:

$ perl -i -pe 's/Windows/Linux/;' test*

This command will search for the word ‘Windows’ inside all files that begin with ‘test’. When it finds one, it will substitute it with the word ‘Linux’. This is useful if you have multiple files that contain the same text. Remember that you can use regular expressions to make searching flexible.

Powered by 1and1.comGlobat Webhosting Earn with Your BlogAdvertise @ PinoyTux

Search PinoyTux

Subscribe to Email Feeds

Enter Email Address:

Blog Lounge

Popular Posts

Recent Posts

Drop your Card Here

Recent Comments

Site Stats