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.
#128 Oliver Christ / 0liverChrist - Score: 41 - 10/05/13 @ 21:46
ddl<C-V>G<End>u:%s/\s.*<CR>:%s/^/\=line(".").'. '<CR>ZZ
0 comments
#129 ltn614 / ltn614 - Score: 41 - 09/28/15 @ 10:52
dd:%s/\t.*<CR>l<C-V>($~:%s/^/\=line('.').". "<CR>ZZ
0 comments
#130 nicolas bo / thevegeta - Score: 42 - 11/09/11 @ 13:52
dd:%s/\s\+\d.*$<CR>guggi0. <Esc>qq0<C-A>yWW~j0Pq9@qZZ
0 comments
#131 Ben Hill / KaizenSoze70 - Score: 42 - 10/17/17 @ 18:39
dd:%s/[^A-Z]//g<CR>l<C-V>($~I1. <Esc>qqjI<C-Y><C-Y><C-Y><Esc>0<C-A>q8@qZZ
0 comments
#132 Tom Adams / holizz - Score: 43 - 12/29/10 @ 01:00
dd:%!cut -f1<CR>:%norm guu~<CR>:%!nl -w1 -s.\ <CR>ZZ
0 comments
#133 Skúli Jóhannsson / skulibj - Score: 43 - 06/28/15 @ 20:17
:%s/\s.*$//g<CR>Vgg~<C-V>G~ddi1. <Esc>qq0yf <CR>P0<C-A>q8@qZZ
0 comments
#134 Dezső Zoltán / zakiazigazi - Score: 44 - 01/22/11 @ 08:18
dd:%!awk '{print NR".",$1}'<CR>qaww<Right>guwj0q9@aZZ
0 comments
#135 Pedro Franceschi / pedroh96 - Score: 44 - 02/06/13 @ 02:15
ddqa0lve~eld$I1. <Esc>jq9@a:2<CR>qqkvyj"_xP<C-A>jq8@qZZ
0 comments
#136 lionel young / lionelyoung - Score: 46 - 12/29/10 @ 00:18
dd:%s/\s.*//<CR>i10. <Esc>qs^yWWl9~k^P^<C-X>q8@sWl9~ZZ
0 comments
#137 Ben Lenarts / benlenarts - Score: 46 - 12/29/10 @ 15:36
dd:%s/\v(\w)(\w*).*\t(\d*)/\3. \1\L\2/<CR>:wq<CR>
0 comments
#138 Peter Krenn / peterkrenn - Score: 47 - 12/29/10 @ 01:17
dd:%s/\v(\u)(\u ).*\s(\d )$/\3. \1\L\2/<CR>:wq<CR>
0 comments
#139 Mike Plotz / antisuji - Score: 47 - 12/29/10 @ 03:04
dd:%s/\(\w\ \).*\s\(\d\ \)/\2. \1<CR>llll~h<C-V>gg$~ZZ
0 comments
#140 Soliman Sylvain / sylvain_soliman - Score: 47 - 12/29/10 @ 17:46
dd:%s/\(.\)\(.*\)<C-V><Tab> .*<C-V><Tab>\(\d*\)$/\3. \1\L\2/<CR>ZZ
0 comments
#141 ise0615 / ise0615 - Score: 47 - 05/04/12 @ 17:32
dd:%s/\(.\)\(.*\)\t .*\t\(\d*\)$/\3. \1\L\2/<CR>ZZ
0 comments
#142 Simon Brown / caelyxsec - Score: 49 - 12/29/10 @ 06:38
dd:%s/^\(.\)\(\w*\).*\s\(\d*\)$/\3. \1\L\2/<CR>ZZ
0 comments
#143 Lasse Højgaard / lhojgaard - Score: 49 - 12/29/10 @ 13:17
dd<C-V>GuVG~:%s/^\(.*\)\W\W.*\W\(.*\)/\2\. \1/g<CR>ZZ
0 comments
#144 Felipe Jaramillo F / mrfelipe - Score: 49 - 04/16/14 @ 03:33
ddqqq1iq. u<Esc>ui1. <Esc>0qqwwlvwuwd$beld$0yW<CR>P0<C-A>q10@qZZ
0 comments
#145 Przemysław Pawełczyk / przemoc86 - Score: 50 - 12/30/10 @ 22:52
!Gsed '1d;s/\(\w*\).*\t\([0-9]*\)$/\2. \L\u\1/'<CR>ZZ
0 comments
#146 Dave / zzdave13 - Score: 51 - 07/15/11 @ 13:31
ddguG:%s/\(\w\+\).*/\u\1/<NL>:%s/^/\=line('.').'. '<NL>ZZ
0 comments
#147 theshadowhost / theshadowhost - Score: 54 - 12/29/10 @ 13:53
dd:%s/\s.*$//<CR>ggI1. <Esc>ll~~~~jqaI<C-Y><C-Y><C-Y><Esc>2lve~^<C-A>jq10@a:x<CR>
0 comments
#148 Luke Ledet / lukeledet - Score: 54 - 12/29/10 @ 15:21
dd:%s/\(\w\)\(\w*\).\{-}\(\d*\)$/\3\. \1\L\2/g<CR>:wq<CR>
0 comments
#149 Justin Knag / justinknag - Score: 55 - 08/30/14 @ 01:15
ddl<C-V>Gell~:%s/\s.*<CR>:%s/^/\=line(.).'. '<CR><CR>:<Up><Left><Left><Left><Left><Left><Left><Left>"<Right>"<CR>ZZ
0 comments
#150 Aaron Bull Schaefer / elasticdog - Score: 58 - 12/29/10 @ 15:44
dd:%s/\s.*<CR>Vgg~gv<C-V>~gvI1. <Esc>j<C-A>jr3jr4jr5jr6jr7jr8jr9ja0<Esc>ZZ
0 comments
#151 Chris Doble / chrisdoble - Score: 58 - 12/30/10 @ 00:27
ddqqVu~f<Tab>d$<Down>^q9@q:g/^/exec "s/^/".line(".").". /g"<CR>ZZ
0 comments
#152 Duda Dornelles / dudadornelles - Score: 59 - 12/29/10 @ 00:22
dd:%s/^\(\w\)\(\w\ \).*\(\d\d\=\)\n/\3. \1\L\2\r<CR>ddi1<Esc>ZZ
0 comments
#153 Arto Vuori / dhpe - Score: 65 - 08/30/12 @ 20:28
dd:%s/\([A-Z]\+\).*/\1/<CR>qalve~k0q9@a:%s/^/\?<BS>=line(".") . ". "<CR>ZZ
0 comments
#154 ivarv / ivarv - Score: 69 - 12/29/10 @ 08:38
ddqalg~wwd$<Esc>j-jq9@a:%s/^/. /<CR>:%!cat -n<CR>:%s/\s\+//<CR>:%s/\./\. /<CR>:wq<CR>
0 comments
#155 jonlorusso / jonlorusso - Score: 88 - 12/30/10 @ 00:04
dd:%s/\(\w\)\(\w*\).*/\1\L\2/<CR>:<BS>:g/^/exec "s/^/".strpart(line(".").". ", 0, 4)<CR>:wq<CR>
0 comments
#156 Josh / karlw00t - Score: 106 - 12/29/10 @ 01:03
<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
#157 drio / drio - Score: 144 - 12/31/10 @ 13: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
#158 Stephen Paul Weber / singpolyma - Score: 168 - 12/29/10 @ 02:33
:%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
#159 Mike Cooper / mythmon - Score: 193 - 12/29/10 @ 23:38
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