screwlisp on Nostr: I saw someone kinda using shell and vim to do potentially fancy string replacements. ...
I saw someone kinda using shell and vim to do potentially fancy string replacements. I was thinking how I could try it in #emacs.
directory
M-x dired <ret> <the directory> <ret>
target extension
M-x occur <ret> .txt <ret>
occur buffer
C-x o C-n
keyboard macro
C-x (
Go to file; open
<ret> <ret>
Arbitrary action
M-x replace-string <ret> target <ret> replacement <ret>
Save and kill buffer
C-x C-s C-x C-k <ret>
Go back to occur, next line
C-x C-b C-n
end kbd macro
C-x )
Do all lines
C-u -1 C-x e
directory
M-x dired <ret> <the directory> <ret>
target extension
M-x occur <ret> .txt <ret>
occur buffer
C-x o C-n
keyboard macro
C-x (
Go to file; open
<ret> <ret>
Arbitrary action
M-x replace-string <ret> target <ret> replacement <ret>
Save and kill buffer
C-x C-s C-x C-k <ret>
Go back to occur, next line
C-x C-b C-n
end kbd macro
C-x )
Do all lines
C-u -1 C-x e