> I have a file which is like below:
> 
> 
> AAA 3
> BB 4
> CCC 1
> DDDDDD 2
> 
> How do I swap the word with the number?
> So that the file looks like:
> 
> 3 AAA
> 4 BB
> 1 CCC
> 2 DDDDDD

A pretty common task, you can use

   :%s/\(.*\)\(\s\+\)\(.*\)/\3\2\1

or a variant thereof depending on how clean your source is.

-tim



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to