Replace in files
Moderators: Hacker, petermad, Stefan2, white
Replace in files
TC has a very cool find files feature (ALT-F7). This dialog also allows finding files with specific content. What I am missing, though, is the feature to replace content in files. Currently I have to use other programs (like Notepad++) to do this.
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I'm sorry, currently this isn't planned: If you apply this by mistake to e.g. Word files, the resulting files will be unusable because of the changed offsets to the formatting information.
Therefore their content would be completely lost. I can recommend that you use an editor (as you already do) with search+replace across documents. This way you can see what you are replacing.
Therefore their content would be completely lost. I can recommend that you use an editor (as you already do) with search+replace across documents. This way you can see what you are replacing.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I understand that this could be a risky operation, so is deleting files. Therefore I always use a file filter (e.g. "*.cpp").
TC should of course warn before actually doing the search&replace operation. Another option (could be disabled/enabled via checkbox) would be to create backup files of those files which need updating in the form of "originalfilepathname".bak. A report at the end of the operation should also list the files which have been touched and how many replacements have been performed.
As I said, it is my most wanted feature which TC is currently lacking.
TC should of course warn before actually doing the search&replace operation. Another option (could be disabled/enabled via checkbox) would be to create backup files of those files which need updating in the form of "originalfilepathname".bak. A report at the end of the operation should also list the files which have been touched and how many replacements have been performed.
As I said, it is my most wanted feature which TC is currently lacking.
Hello, Habilitus.
Perhaps another argument not to implement a global search and replace in Total Commander is that this actually means re-inventing the wheel which will require a lot of time and effort:
At minimum a module will be needed which can be compared to the Unix/Linux command sed.
The results of the "sed" operation will have to be displayed in an appropriate Windows like way. We are not on a Unix commandline after all.
Soon there will be requests to allow the user to confirm or deny the changes which the "sed" module is about to perform.
In short words, in the end Christian will be creating and implementing a Total Commander internal text editor which can perform global search and replace operations.
Yet, such text editors do already exist. And a few of them are really powerful.
Just my two and a half cents.
Cheers,
Karl
Perhaps another argument not to implement a global search and replace in Total Commander is that this actually means re-inventing the wheel which will require a lot of time and effort:
At minimum a module will be needed which can be compared to the Unix/Linux command sed.
The results of the "sed" operation will have to be displayed in an appropriate Windows like way. We are not on a Unix commandline after all.
Soon there will be requests to allow the user to confirm or deny the changes which the "sed" module is about to perform.
In short words, in the end Christian will be creating and implementing a Total Commander internal text editor which can perform global search and replace operations.
Yet, such text editors do already exist. And a few of them are really powerful.
Just my two and a half cents.
Cheers,
Karl