FILENAMESEARCHREPLACE-SeachandreplacefilenameswithinadirectoryFILENAMESEARCHREPLACE(DIRNAME,SEARCHSTRS,REPLACESTRS,...)ThisfunctionsearchesallfilesinthedirectoryDIRNAMEformatchesofanystringinthecellarrayofstringsSEARCHSTRS.Ifitfindsamatch,thenitcreatesanewfilewiththesearchstringreplacedbythecorrespondingentryinthecellarrayofstringsREPLACESTRS.Thisfunctionalsocanbemodifiedbyname/valuepairs:Parameter(default)|Description----------------------------------------------------------------deleteOriginals(0)|Shouldoriginalfilebedeleted?
useOutputDir(0)|Shouldwewritetoadifferentoutputdirectory?
OutputDirPath(DIRNAME)|TheparentpathoftheoutputdirectoryOutputDir('subfolder')|ThenameoftheoutputdirectryinOutputDirPath|(willbecreatedifitdoesn'texist)noOp(0)|If1,thiswillnotperformtheoperationbutwill|displayitsintendedactionrecursive(0)|Shouldwecallthisrecursivelyonsubdirectories?
Seealso:NAMEVALUEPAIRExample:Supposemydirnamehasafile'.ext1'.filenamesearchreplace(mydirname,{'.ext1'},{'.ext2'},'deleteOriginals',1)% renames any files with '.ext1' to have '.ext2', deleting old files