Reformat most common surnames
Reformat copy-pasted table into a list of the most common surnames
Start file
Surname Approx Number % Frequency Rank SMITH 2,501,922 1.006 1 JOHNSON 2,014,470 0.81 2 WILLIAMS 1,738,413 0.699 3 JONES 1,544,427 0.621 4 BROWN 1,544,427 0.621 5 DAVIS 1,193,760 0.48 6 MILLER 1,054,488 0.424 7 WILSON 843,093 0.339 8 MOORE 775,944 0.312 9 TAYLOR 773,457 0.311 10
End file
1. Smith 2. Johnson 3. Williams 4. Jones 5. Brown 6. Davis 7. Miller 8. Wilson 9. Moore 10. Taylor
View Diff
1,11c1,10 < Surname Approx Number % Frequency Rank < SMITH 2,501,922 1.006 1 < JOHNSON 2,014,470 0.81 2 < WILLIAMS 1,738,413 0.699 3 < JONES 1,544,427 0.621 4 < BROWN 1,544,427 0.621 5 < DAVIS 1,193,760 0.48 6 < MILLER 1,054,488 0.424 7 < WILSON 843,093 0.339 8 < MOORE 775,944 0.312 9 < TAYLOR 773,457 0.311 10 --- > 1. Smith > 2. Johnson > 3. Williams > 4. Jones > 5. Brown > 6. Davis > 7. Miller > 8. Wilson > 9. Moore > 10. Taylor
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
#100 Tom Adams / @holizz - Score: 43 - 12/28/10 @ 17:00
dd:%!cut -f1<CR>:%norm guu~<CR>:%!nl -w1 -s.\ <CR>ZZ
0 comments
#101 Dezső Zoltán / @zakiazigazi - Score: 44 - 01/22/11 @ 00:18
dd:%!awk '{print NR".",$1}'<CR>qaww<Right>guwj0q9@aZZ
0 comments
#102 Pedro Franceschi / @pedroh96 - Score: 44 - 02/05/13 @ 18:15
ddqa0lve~eld$I1. <Esc>jq9@a:2<CR>qqkvyj"_xP<C-A>jq8@qZZ
0 comments
#103 lionel young / @lionelyoung - Score: 46 - 12/28/10 @ 16:18
<fd-35>dd:%s/\s.*//<CR>i10. <Esc>qs^yWWl9~k^P^<C-X>q8@sWl9~ZZ
0 comments
#104 Ben Lenarts / @benlenarts - Score: 46 - 12/29/10 @ 07:36
<fd-35>dd:%s/\v(\w)(\w*).*\t(\d*)/\3. \1\L\2/<CR>:wq<CR>
0 comments
#105 Peter Krenn / @peterkrenn - Score: 47 - 12/28/10 @ 17:17
<fd-35>dd:%s/\v(\u)(\u ).*\s(\d )$/\3. \1\L\2/<CR>:wq<CR>
0 comments
#106 Mike Plotz / @antisuji - Score: 47 - 12/28/10 @ 19:04
dd:%s/\(\w\ \).*\s\(\d\ \)/\2. \1<CR>llll~h<C-V>gg$~ZZ
0 comments
#107 Soliman Sylvain / @sylvain_soliman - Score: 47 - 12/29/10 @ 09:46
dd:%s/\(.\)\(.*\)<C-V><Tab> .*<C-V><Tab>\(\d*\)$/\3. \1\L\2/<CR>ZZ
0 comments
#108 ise0615 / @ise0615 - Score: 47 - 05/04/12 @ 10:32
dd:%s/\(.\)\(.*\)\t .*\t\(\d*\)$/\3. \1\L\2/<CR>ZZ
0 comments
#109 Simon Brown / @caelyxsec - Score: 49 - 12/28/10 @ 22:38
<fd-35>dd:%s/^\(.\)\(\w*\).*\s\(\d*\)$/\3. \1\L\2/<CR>ZZ
0 comments
#110 Lasse Højgaard / @lhojgaard - Score: 49 - 12/29/10 @ 05:17
<fd-35>dd<C-V>GuVG~:%s/^\(.*\)\W\W.*\W\(.*\)/\2\. \1/g<CR>ZZ
0 comments
#111 Przemysław Pawełczyk / @przemoc86 - Score: 50 - 12/30/10 @ 14:52
!Gsed '1d;s/\(\w*\).*\t\([0-9]*\)$/\2. \L\u\1/'<CR>ZZ
0 comments
#112 Dave / @zzdave13 - Score: 51 - 07/15/11 @ 06:31
ddguG:%s/\(\w\+\).*/\u\1/<NL>:%s/^/\=line('.').'. '<NL>ZZ
0 comments
#113 theshadowhost / @theshadowhost - Score: 54 - 12/29/10 @ 05:53
<fd-35>dd:%s/\s.*$//<CR>ggI1. <Esc>ll~~~~jqaI<C-Y><C-Y><C-Y><Esc>2lve~^<C-A>jq10@a:x<CR>
0 comments
#114 Luke Ledet / @lukeledet - Score: 54 - 12/29/10 @ 07:21
<fd-35>dd:%s/\(\w\)\(\w*\).\{-}\(\d*\)$/\3\. \1\L\2/g<CR>:wq<CR>
0 comments
#115 Aaron Bull Schaefer / @elasticdog - Score: 58 - 12/29/10 @ 07:44
<fd-35>dd:%s/\s.*<CR>Vgg~gv<C-V>~gvI1. <Esc>j<C-A>jr3jr4jr5jr6jr7jr8jr9ja0<Esc>ZZ
0 comments
#116 Chris Doble / @chrisdoble - Score: 58 - 12/29/10 @ 16:27
<fd-35>ddqqVu~f<Tab>d$<Down>^q9@q:g/^/exec "s/^/".line(".").". /g"<CR>ZZ
0 comments
#117 Duda Dornelles / @dudadornelles - Score: 59 - 12/28/10 @ 16:22
<fd-35>dd:%s/^\(\w\)\(\w\ \).*\(\d\d\=\)\n/\3. \1\L\2\r<CR>ddi1<Esc>ZZ
0 comments
#118 Arto Vuori / @dhpe - Score: 65 - 08/30/12 @ 13:28
dd:%s/\([A-Z]\+\).*/\1/<CR>qalve~k0q9@a:%s/^/\?<BS>=line(".") . ". "<CR>ZZ
0 comments
#119 ivarv / @ivarv - Score: 69 - 12/29/10 @ 00:38
<fd-35>ddqalg~wwd$<Esc>j-jq9@a:%s/^/. /<CR>:%!cat -n<CR>:%s/\s\+//<CR>:%s/\./\. /<CR>:wq<CR>
0 comments
#120 fake Jon Lorusso / @jonlorusso - Score: 88 - 12/29/10 @ 16:04
<fd-35>dd:%s/\(\w\)\(\w*\).*/\1\L\2/<CR>:<BS>:g/^/exec "s/^/".strpart(line(".").". ", 0, 4)<CR>:wq<CR>
0 comments
#121 Josh / @karlw00t - Score: 106 - 12/28/10 @ 17:03
<fd-35><Esc>ddi1<Esc>qqa. <Esc>llvf ~f hd$<Esc>j0qi2<Esc>@qi3<Esc>@q<Esc>i4<Esc>@qi5<Esc>@q<Esc>i6<Esc>@q<Esc>7<Esc>i7<Esc>@q<Esc>i8<Esc>@q<Esc>9i9<Esc>@q<Esc>uu<Esc><Esc><Esc>i9<Esc>@qi19<Esc>i0<Del><Esc>@q<Esc>:wq<CR>
0 comments
#122 drio / @drio - Score: 144 - 12/31/10 @ 05:03
dd<C-V>jjjjjjjjjjllllllu<C-V>jjjjjjjjjjjjjjjUw<C-V>10jwwwwwllld3Gwdw..1Gw<C-V>jjjjjjjjjjjjjjjjld<Esc>0P<Esc>:%s/\s/. /<CR><Esc>:<Up><Left><Left><Left><Left>\+$<Right><Right><Right><BS><BS><CR><Esc>lli. <Esc>$D<Esc>:x<CR>
0 comments
#123 Stephen Paul Weber / @singpolyma - Score: 168 - 12/28/10 @ 18:33
<fd-35>:%s/\s.*$//g<CR><Right>gu$<Up>.<Up>.<Up>.<Up>.<Up>.<Up>.<Up>.<Up>.<Up>.<Up>ddI. <Esc><Down>.<Down>.<Down>.<Down>.<Down>.<Down>.<Down>.<Down>.<Down>.<Down>I10<Esc><Up>I9<Esc><Up>I8<Esc><Up>I7<Esc><Up>I6<Esc><Up>I5<Esc><Up>I4<Esc><Up>I3<Esc><Up>I2<Esc><Up>I1<Esc>:wq<CR>
0 comments
#124 Mike Cooper / @mythmon - Score: 193 - 12/29/10 @ 15:38
<fd-35>dd:%s/\(.*\)\t.(<BS>*\t.*\t\(.*\)$/\2. \1/g<CR>Vkkkkkkkkkkkk:%s/[<BS>\([A-Z]\)\(.*\)/\1\L\2/<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><BS><BS><BS><BS><CR>:wq<CR>
0 comments
VimGolf