I have a whole bunch of files with certain patternsABCD: Something 1 Anything 2EFGH:Something 3Anything 4ABCD:Something 5Anything 6HIJK:Something 7Anything 8I want to retain the second line after ABCD and delete everything else in all these files. On a single file, this can be achieved using vim by the following commands/ABCD\_[^a-zA-Z] (*searches the pattern*)qaq              (*flush register*):g//norm! A3Y   (*yank 3 lines including pattern into register A*)ggVGap          (*delete everything else*)Then I can perform some easy regex searches to delete the ABCDs and Somethings to be left with the correct Anythings.However using args and argdo as suggested here for multiple files throws up errors Not an editor command at the second operation above. Same thing happens if I bypass the second, and go directly to the third and fourth. I am performing args and argdo after each step.Any recommendations staying within or going beyond vim?
Delete all but multiple lines across multiple files
awk;vim;regular expression;delete