How to substitute a particular string in a file containing millions of records?

Questions by ms_2007

Showing Answers 1 - 3 of 3 Answers

ratul2783

  • May 3rd, 2010
 

perl -p -i -e "s/search_string/replace_string/g" SourceFile

The -p option ensures that $_ is assigned each line of each input file in turn and that the program is executed once for each input line.

The -i option, when used with the -p option, takes the input lines being read and writes them back out to the files from which they came.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions