Tag: replace
Replacing in Found Files
June 25, 2009
Replace one string by another in all file found by find. find . -name *whatyouwant* -exec perl -pi.bak -e ‘s/TEXT_TO_REPLACE/TEXT_TO_REPLACE_IT_WITH/g’…
Using M4 Command
December 18, 2007
This command takes an input file and substitutes strings inside it with the parameters passed, similar to substituting for variables….
Simple Sed Command
November 25, 2007
Change all occurrences of ‘one’ to ‘two’ in the file.txt file in the grep example, enter this: sed ‘s/one/two/g’ file.txt
Replace \n with another String
June 29, 2007
The command to convert all \n in a file to another string – very useful for list code generation. perl…
Command to Replace a String in all Files in Current Directory
March 12, 2007
Replaces all instance of ‘<old string>’ with ‘<new sting>’ in all the files of the current directory. perl -pi -e…
Changing separator with Perl
March 7, 2007
This will join all lines of a file together. Sometimes I have a list of something in a file, one…
Recent Comments