123048RE: sorting based on numercial value
- May 2, 2011googler wrote:
> I have a text file with a number of lines in it. Each lineIf there are no numbers in string1 and string2:
> has the same format, say something like below.
> <string1> <string2> <number> <string3>
> I want to sort this file based on the numerical value of the
> <number> field. How can I do this in vim? Thanks.
The 'n' gives a numeric sort, based on the first number in each
line. It is also possible to include a pattern. There are two
options. First, skip everything up to and including the pattern
(sort on what comes next; that's the default). Second (if r flag
specified), sort on the text matching the pattern.
If a problem, give real examples of typical data.
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic Next post in topic >>