Wednesday, February 24, 2010

search & replace string from terminal

I want to search & replace string in 10MB of text file. The Gedit spend 20 - 30 minutes to finish this task but I can finish in 2 second by this command

cat source_file.txt | sed 's/searchstring/replacestring/g' > output.txt

pretty cool!