I just started using Emacs and so far I am very impressed (but maybe also a bit overwhelmed). Some days ago, I had to replace a string in one file, and an entire second file for all directories that existed in the root path. I solved this by writing a batch file. (this was a Windows XP machine). Now, I just found this link http://ergoemacs.org/emacs/find_replace_inter.html and I have the strange feeling that this procedure would be possible with Emacs. Is this correct ?
Asked
Active
Viewed 118 times
1
-
How did you do this with a batch file? Link to gist? – event_jr Aug 19 '12 at 01:11
-
I created two batch files. The first one looks like this: for /f "tokens=*" %%g in ('dir c:\ /b /ad') do call test2.bat %%g It calls the second one with the retrieved results (in that case every name of every directory in the root path). The second file simply executes the copy / replace operation. It looks like this: copy /Y myfile.txt D:\SomeSourceDir\SomeSourceSubDir\%1\SomeDestSubDir\ – user1017102 Aug 19 '12 at 01:22
-
For recursive text replacement in files which are not opened, check this question: [Using Emacs to recursively find and replace in text files not already open](http://stackoverflow.com/questions/270930/using-emacs-to-recursively-find-and-replace-in-text-files-not-already-open) – raju-bitter Aug 19 '12 at 17:51
1 Answers
0
It is.
A tour of the info manual will probably be helpful. Maybe start with:
M-x info-lookup-symbol RET dired-do-rename

tshepang
- 12,111
- 21
- 91
- 136

Andreas Röhler
- 4,804
- 14
- 18