Quantcast
Channel: Using Emacs to recursively find and replace in text files not already open - Stack Overflow
Browsing latest articles
Browse All 16 View Live

Answer by Hi-Angel for Using Emacs to recursively find and replace in text...

Surprisingly, no answer was given yet to make use of -batch Emacs mode that has been created for situations like this. So here's a simple example:$ echo foo > 1 && echo foo > 2 &&...

View Article



Answer by mcp for Using Emacs to recursively find and replace in text files...

M-xproject-query-replace-regexpRET (make sure your files are saved!).M-xrgrepRET then query-replace within each buffer. Nice because you can keep track of all occurrences, and because it let's you...

View Article

Answer by eflanigan00 for Using Emacs to recursively find and replace in text...

Projectile is really nice: C-c p r runs the command projectile-replace

View Article

Answer by Andrzej Pronobis for Using Emacs to recursively find and replace in...

I would like to suggest one more great tool which has not been mentioned yet, namely Helm. It is a great replacement for many standard Emacs operations involving completion, searching etc. In...

View Article

Answer by Drew for Using Emacs to recursively find and replace in text files...

find-name-dired is OK, but:All of the files you get match the same, single regexp.find-dired is more flexible in that regard, but it too is made for using general rules (even if they can be arbitrarily...

View Article


Answer by Prashant Sharma for Using Emacs to recursively find and replace in...

Source of information: 1For emacs pro users:Call dired to list files in dir, or call find-dired if you need all subdirectories. Mark the files you want. You can mark by regex by typing 【% m】.Type Q to...

View Article

Answer by Zack Murray for Using Emacs to recursively find and replace in text...

M-X Dired, and t to mark all files, and Q to query replace text in all of them.You can expand a sub directory by using the i command before the query-replace.They key info I'm adding is that if you...

View Article

Answer by ocodo for Using Emacs to recursively find and replace in text files...

The answers provided are great, however I thought I'd add a slightly different approach.It's a more interactive method, and requires wgrep, rgrep and iedit. Both iedit and wgrep must be installed via...

View Article


Answer by blais for Using Emacs to recursively find and replace in text files...

It's not Emacs, but xxdiff comes with a tool called xx-rename which will do that for multiple strings at a time (e.g. From To from to FROM TO), with interactive prompting, save backups of all the...

View Article


Answer by yPhil for Using Emacs to recursively find and replace in text files...

For open buffers, this is what I do :(defun px-query-replace-in-open-buffers (arg1 arg2)"query-replace in all open files" (interactive "sRegexp:\nsReplace with:") (mapcar (lambda (x) (find-file x)...

View Article

Answer by Drew for Using Emacs to recursively find and replace in text files...

Another option is to use Icicles search. This is a different kind of incremental search that uses completion of your minibuffer input against search hits. As you modify your current input the set of...

View Article

Answer by Frank Henard for Using Emacs to recursively find and replace in...

M-x find-name-dired RETit may take some time for all the files to appear in the list, scroll to bottom (M->) until "find finished" appears to make sure they all have loadedPress t to "toggle mark"...

View Article

Answer by Alex Coventry for Using Emacs to recursively find and replace in...

Using dired to recurse down a deep directory tree is going to be a bit slow for this task. You might consider using tags-query-replace. This does mean shelling out to create a tags table, but that is...

View Article


Answer by Chris Conway for Using Emacs to recursively find and replace in...

M-x find-name-dired: you will be prompted for a root directory and a filename pattern.Press t to "toggle mark" for all files found.Press Q for "Query-Replace in Files...": you will be prompted for...

View Article

Answer by Blair Conrad for Using Emacs to recursively find and replace in...

I generally use other tools to perform this task, and it seems like many of the approaches mentioned at EmacsWiki's Find and Replace Across Files entry shell out, but the Findr Package looks very...

View Article


Using Emacs to recursively find and replace in text files not already open

As a follow-up to this question, it's trying to find out how to do something like this which should be easy, that especially stops me from getting more used to using Emacs and instead starting up the...

View Article
Browsing latest articles
Browse All 16 View Live




Latest Images