Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 54e2169fb89efb2ab10012e6

Sorting database text output

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

Start file
      0 |    1
      0 |   24
      1 |    1
      1 |    2
      1 |    3
      1 |    4
      1 |   15
      1 |   24
      1 |   62
      1 |  107
      2 |    1
      2 |    2
      2 |    8
      2 |   15
      2 |   18
      2 |   25
      2 |   28
      2 |   47
      2 |   65
      2 |   69
      2 |   76
      2 |   99
      2 |  103
      2 |  110
      2 |  153
      3 |    3
      3 |   32
      3 |   49
      3 |   65
      3 |   76
      3 |   96
      4 |    2
End file
1, 2, 3, 4, 8, 15, 18, 24, 25, 28, 32, 47, 49, 62, 65, 69, 76, 96, 99, 103, 107, 110, 153

View Diff

1,32c1
<       0 |    1
<       0 |   24
<       1 |    1
<       1 |    2
<       1 |    3
<       1 |    4
<       1 |   15
<       1 |   24
<       1 |   62
<       1 |  107
<       2 |    1
<       2 |    2
<       2 |    8
<       2 |   15
<       2 |   18
<       2 |   25
<       2 |   28
<       2 |   47
<       2 |   65
<       2 |   69
<       2 |   76
<       2 |   99
<       2 |  103
<       2 |  110
<       2 |  153
<       3 |    3
<       3 |   32
<       3 |   49
<       3 |   65
<       3 |   76
<       3 |   96
<       4 |    2
---
> 1, 2, 3, 4, 8, 15, 18, 24, 25, 28, 32, 47, 49, 62, 65, 69, 76, 96, 99, 103, 107, 110, 153

Solutions by @yuanguan89:

Unlock 1 remaining solutions by signing in and submitting your own entry
Created by: @kirk_bauer

83 active golfers, 223 entries

Solutions by @yuanguan89:
26
#61 - Yuan Guan / @yuanguan89

03/02/2015 at 04:50AM