Tuesday, May 4, 2010

using perl to replace all occurences of a word with another in large files

rather simple, we want to replace all occurences of the word 'volatile' with 'volatile2' in a large text file and so just execute


perl -i -p -e 's{volatile}{volatile2}g' /mnt/storage/data/export


I can't believe I'm using perl again...

No comments:

Post a Comment