101
Support and Feedback / Re: Find & Replace or MultiScript to edit & output XML?
« on: December 08, 2022, 16:44:24 »
Well, S&R works:
The full automation requires parsing CSV-file, of course. If its structure is known and "stable", it shouldn't be hard.
UPD. Actually, parsing CSV might be quite hard (in MC).
Code: [Select]
@var $sel_files = GetSourceSelectedPaths();
@var $sel_count = arrayCount($sel_files);
@var $find_text = "aaa\\nbbb";
@var $repl_text = "xxx\\nyyy";
@var $n;
for($n = 0; $n < $sel_count; $n++)
{
@var $file = $sel_files[$n];
# @var $new_file = PathGetPathPart($file) ^ PathGetNamePart($file, 1) + "_new" + PathGetFileExtPart($file);
@var $new_file = "*_new.*";
MC.Utils.FindAndReplace MODE="Many" FIND={$find_text} REPLACEWITH={$repl_text} FILE="{$file}" TARGET="{$new_file}" SILENT REPLACEALL OVERWRITE
}
The full automation requires parsing CSV-file, of course. If its structure is known and "stable", it shouldn't be hard.
UPD. Actually, parsing CSV might be quite hard (in MC).