Replacing alternate line in vi text file with a particular string
问题 I have text file which consists of 5 columns , if i want to replace every alternate line in second column with particular string ,how can do this in vi text editor? eg: 1 CG 54 76 76 2 CG 45 78 78 3 CG 48 76 89 4 CG 49 50 52 if i want to replace 2 nd and 4 th line (2nd column) with CA how can i do this in vi text editor? 回答1: If you're using vim, this is a simple macro. If you're not sure if you're using vim, then in command mode, type qq and check that you see recording in the status line at