* Jeri Raye <[email protected]> [2009-10-12 22:22 +0200]:
> I want to check several new-articles on the occurences of words
> Therefore the two questions:
> 
> 1) How to let vim place a carriage return after each word in an news-article?

:%s/[^a-zA-Z']\+/\r/g

Not ideal but works in most cases for English.

> And 2) If you have a text like this
> 
> AAA
> AAA
> AAA
> BBB
> CCC
> CCC
> CCC
> CCC
> 
> can you let vim count the occurences of these words and add a number
> before them and delete all but the first one?
> So that the text above becomes:
> 
> 3 AAA
> 1 BBB
> 4 CCC

:%!sort | uniq -c

Requires Unix-like text tools, so if you're on Windows, you'll need
Cygwin or Unxutils.

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

Reply via email to