Loading ...
Sorry, an error occurred while loading the content.

96976RE: Vim Tips wiki celebrates with a CSV tip

Expand Messages
  • John Beckett
    Oct 11, 2008
    • 0 Attachment
      nh_wzg wrote:
      > With the updated code,the result of the example I post above
      > with the ":Sort 1 n" is:

      See the new documentation just above the script:
      http://vim.wikia.com/wiki/Working_with_CSV_files

      The command ":Sort 1 n" uses the built-in Vim :sort command to sort by integers.

      If you want to sort floating point numbers, you need ":Sort 1 f" which uses new code
      in the script to sort using floats. Your sample sorts perfectly using that command.

      The "f" option should correctly sort integers (0, -12, 1234 etc), and floats (.5,
      123.456, -1.73, +12.5, 1e3 etc). Use ":Sort! 1 f" to sort in reverse order.

      When using "f", any fields in the column being sorted that are not numbers are
      sorted as strings. All strings sort before numbers. String sorting is case
      insensitive if the 'ignorecase' option is set.

      John


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 25 messages in this topic