|
|
|
|
|
by fakedrake
2964 days ago
|
|
Good to know about ed! Since noone else has mentioned this, emacs' keyboard macros seem much easier to me especially since more than the basic editing stuff off awk/ed/sed i can leverage all the editor extensions and modifications i have accumulated over the years. That is unless its tens of thousands of files and the edit is exceptionally simple. I would write a script in that case too. |
|
Let's say I have:
and I want the second column in uppercase.<F3> to start recording a macro. Alt →, → to position the cursor at "v" (or just →→→→→→ if this is a fixed width column), then Alt U to uppercase the next word. → to move the cursor one forward, to the start of the next line. <F4> to finish recording the macro.
Then press <F4> five times to run the macro five times.
(Explanation intended for users who've never used Emacs before. Of course, there are optimizations.)