Multi Commander Support Forum

Multi Commander => Support and Feedback => Topic started by: causative on September 12, 2014, 13:09:06

Title: replace the string inside file
Post by: causative on September 12, 2014, 13:09:06
Is it possible in MC to replace the string in file without opening it ( manualy we open the file, press  ctrl + h and replace the string "aaa" to "bbb" )
I would like to use it in many files at the same time.
Title: Re: replace the string inside file
Post by: Mathias (Author) on September 12, 2014, 16:09:54
From Script it is possible

Code: [Select]
@var $text = LoadStringFromFile( "R:\\file.txt" );
$text = StrReplace($text, "hulk" , "thor");
SaveStringToFile("R:\\file.txt", $text, 0);

And you can expand the script to so it asks for what it should find and replace it with..
Title: Re: replace the string inside file
Post by: causative on September 12, 2014, 16:57:44
thx