On 8/3/06, Eric Leenman <[EMAIL PROTECTED]> wrote:
I have file which contains hexadecimal numbers like below:

04F  ---  05F  ---  052  ---  188  ---  2D4  ---  173  ---  040  ---  18D
051  ---  040  ---  05F  ---  1CA  ---  2E8  ---  14F  ---  040  ---  1E2
051  ---  040  ---  069  ---  1B9  ---  2D7  ---  15E  ---  040  ---  1A6
051  ---  040  ---  06F  ---  1ED  ---  2EB  ---  12E  ---  040  ---  209
051  ---  040  ---  078  ---  1F9  ---  2E3  ---  122  ---  040  ---  220
051  ---  045  ---  063  ---  1C8  ---  2D1  ---  146  ---  040  ---  1F4
051  ---  046  ---  05A  ---  1BB  ---  2D7  ---  158  ---  040  ---  1D3
051  ---  052  ---  04F  ---  1B6  ---  2E3  ---  154  ---  040  ---  1BB
052  ---  040  ---  045  ---  1BC  ---  2D6  ---  146  ---  040  ---  1CE
052  ---  040  ---  04A  ---  1BC  ---  2DD  ---  146  ---  040  ---  1D3

How can I sort the columns so that they are as the first column?

Dr. Chip's vis.vim plugin to the rescue, again (*1).
Dr. Chip's plugin allows more than substitute-in-
visual-blocks. It allows you to apply external shell command
to the visual block !, which is exactly what we need.

1. install Dr.Chip's visual operations plugin from
  http://www.vim.org/scripts/script.php?script_id=1195
  "vis : Extended Visual Mode Commands"

2. Ctrl-V and select the vertical column of numbers

3. type
    :B ! sort
which appears on screen as
   :'<,'>B !sort

Which sorts one vertical column !

Yakov

P.S. Incidentally, windows has external sort command, too.

Reply via email to