The macro below performs a search/replace command on all open files, saving and closing each file as it goes.
I have two questions concerning the "bak" files that are created automatically for each file the macro processes.
1. Is there a macro command to prevent the bak files from being created entirely?
2. Is there a way to have a bak file created ONLY in the event that changes are actually made to the file? That is, if after the search/replace, the file has not been changed, don't save it, or save it but don't create a bak file.
I have two questions concerning the "bak" files that are created automatically for each file the macro processes.
1. Is there a macro command to prevent the bak files from being created entirely?
2. Is there a way to have a bak file created ONLY in the event that changes are actually made to the file? That is, if after the search/replace, the file has not been changed, don't save it, or save it but don't create a bak file.
Code: Select all
InsertMode
ColumnModeOff
HexOff
UnixReOn
Loop
IfNameIs ""
ExitLoop
EndIf
Find RegExp "([^,\n])"([^,\n])"
Replace All "\1(qt)\2"
CloseFile Save
EndLoop