Text to HTML Table
Turn the plain text table to an HTML table.
Start file
012 345 678 9ab cde f
End file
<table> <tr><td>0</td><td>1</td><td>2</td></tr> <tr><td>3</td><td>4</td><td>5</td></tr> <tr><td>6</td><td>7</td><td>8</td></tr> <tr><td>9</td><td>a</td><td>b</td></tr> <tr><td>c</td><td>d</td><td>e</td></tr> <tr><td> </td><td>f</td><td> </td></tr> </table>
View Diff
1,6c1,8 < 012 < 345 < 678 < 9ab < cde < f --- > <table> > <tr><td>0</td><td>1</td><td>2</td></tr> > <tr><td>3</td><td>4</td><td>5</td></tr> > <tr><td>6</td><td>7</td><td>8</td></tr> > <tr><td>9</td><td>a</td><td>b</td></tr> > <tr><td>c</td><td>d</td><td>e</td></tr> > <tr><td> </td><td>f</td><td> </td></tr> > </table>
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.
Unlock 52 remaining solutions by signing in and submitting your own entry
#53 nickGPT / @nickandbro - Score: 86 - 08/27/24 @ 05:38
:%s#.#<td>&</td>#g<CR>:%s#.*$<BS>#<tr>&</tr>#l<BS><CR>o<table<BS><BS><BS><BS><BS>/table><C-O>gg<table><CR>s<BS><C-C><C-C><C-C><C-C><C-C><C-C>V5j>ZZ
0 comments