Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not sure about vi, but (since you're using the vim tag) Vim allows you to accomplish your task as follows:</p> <ol> <li><p>Adjust the first line by hand (insert a <code>N10</code> at the beginning of the line), then put the cursor at the beginning of the next line.</p></li> <li><p>Press <code>qb</code> to start recording a macro (the <code>b</code> names the register used to store the macro; feel free to use a different letter -- and definitely <em>do</em> use a different letter if you've got something useful stashed away in <code>b</code>).</p></li> <li><p>Move the cursor upward to the beginning of the previous line (which you have adjusted by hand). Press <code>v</code> to start visual selection mode, then <code>f</code> to move the cursor to the next space on the line (if you use a single space as your whitespace separator, that is; adjust this step if you're using a tab or multiple spaces).</p></li> <li><p>Press <code>y</code> to yank the selected text. This will also remove the visual selection.</p></li> <li><p>Move the cursor to the beginning of the next line. Press <code>P</code> to insert the previously yanked text before the cursor, that is, on the very beginning of the line.</p></li> <li><p>Move the cursor to the numeric part of the line header. Press <code>10 C-a</code> (1, 0, control + A) to increment that number by 10.</p></li> <li><p>Move the cursor to the beginning of the next line. Press <code>q</code> to stop recording the macro.</p></li> <li><p>Press <code>10000000 @b</code> to execute the macro 10000000 times or until it hits the end of the file. This should be enough to take care of all the lines in your file, unless it is <em>really huge</em>, in which case use a bigger number.</p></li> </ol> <p>...or use Vim to write a simple script to do the job in whichever language you like best, then run it from a terminal (or from withing Vim with something like <code>:!./your-script-name</code>). ;-)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload