On 07/21/2010 11:08 AM, rudy_b wrote:

Hi all,
I would truley thank you if you can help me with my issue. It's been few
hours I am trying to solve this, but no luck yet!!

I want to do a substitution using the (/s) command. But I am ONLY interested
in substituting multiples of 100th line.
In other words, I have a huge file (thousands of lines); and, I want to go
through this file, and look for lines #100, #200, #300, #400, ... and append
the word "checked" at the end of these line.
for example:
1. this is my line #1
2. this is my line #2
3. this is my line #3
...
100. this is my line #4 (CHECKED)
101. this is my line #101
...
199 this is my line #199
200. this is my line #200 (CHECKED)
...
and so on...

Does anyone know how can I do this?

I tried to look into substituting with the aid of visual selection. (e.g.
:$s/\v) but was not able to do such a selection to select multiples of 100th
line.

thanks for your help in advnace.

Rudy

The easiest way is probably to make a recording. Starting on 100th line,
press qq, then A (CHECKED), then 100j, then q. To run it, do something
like 9...@q - it will be run 999 times or stop if it reaches end of file.
Check the last line, if it has (CHECKED), check if it's correct line
number. I think it should work fine even on the last line but just to be
sure, won't hurt to check...

-ak

--
It is possible to be a master in false philosophy, easier, in fact, than to
be a master in the truth, because a false philosophy can be made as simple
and consistent as one pleases.  George Santayana

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to