1. Go to edit mode by pressing Esc (Escape Button).
2. Go to the line which you want to swap with the line following.
Example:
1 Singh Jat
2 Mitesh
3. Press dd, then press p. You will find the two line are swapped.
Example:
1 Mitesh
2 Singh Jat
Subscribe to:
Post Comments (Atom)

1 comment:
There are 100 lines in my file, I want to swap every adjacent two lines, up to the end of file. How Can I do it.
Example:
1.MY
2.DESKTOP
3.SIZE
4.BIG
Now I want to make a file like,
1.DESKTOP
2.MY
3.BIG
4.SIZE
How can I do this?
Post a Comment