Multi Commander > Support and Feedback

replace the string inside file

(1/1)

causative:
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.

Mathias (Author):
From Script it is possible


--- Code: ---@var $text = LoadStringFromFile( "R:\\file.txt" );
$text = StrReplace($text, "hulk" , "thor");
SaveStringToFile("R:\\file.txt", $text, 0);
--- End code ---

And you can expand the script to so it asks for what it should find and replace it with..

causative:
thx

Navigation

[0] Message Index

Go to full version