Hello Antoine,
Thanks for your post. I tried both the options but i could not get any
result. I am using gvim. Please help.
Regards,
Auro Ashish Saha.
> Auro Ashish Saha wrote:
>> Hello,
>>
>> Please help me to remove alternate lines from a text file.
>>
>> 00 0
>> 123456 9
>> 99 9
>> 123445 9
>>
>> I want to delete the line 1, 3, 5 and so on. What are the commands to be
>> used. Thanks for help in advance.
>>
>> Regards,
>>
>> Auro Ashish Saha.
>>
>>
>>
>
> Method I:
>
> q"ddjjq
> @"
>
> where is equal to the number of lines still to be deleted
>
> Method II (all on one line if typed on the Vim command-line):
>
> :let i=1 | while i <= line('$') | if (i % 2) | exe i . "delete" |
> endif |
> endwhile
>
>
> Best regards,
> Tony.
> --
> Idaho state law makes it illegal for a man to give his sweetheart a box
> of candy weighing less than fifty pounds.
>
--
Auro Ashish Saha
QIP Ph.D. Research Scholar
Suman Mashruwala Laboratory
Mechanical Engineering Department
IIT Bombay, Powai
Mumbai - 400 076
India
Mobile: 09969074835
Email: [EMAIL PROTECTED]
[EMAIL PROTECTED]