Re: grep sed replace

"Thierry Blanc [email protected] [sed-users]" <[email protected]> Thu, 10 Nov 2016 16:45:10 +0200
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
sed -r '/Tom/{n;n;s|.*|MY NEW STRING|}' yourfile

sorry, only 2 n!

On 10/11/16 16:09, Thierry Blanc [email protected] [sed-users] wrote:
>
> sed -r '/Tom/{n;n;n;s|.*|MY NEW STRING|}' yourfile
>
>
> find Tom, go 3 lines down, change line
>
> On 10/11/16 16:03, MOKRANI Rachid [email protected] [sed-users] wrote:
>> Paul Brown
>> monday
>> 0.8
>> Mike Blue
>> monday
>> 0.8
>> Tom Red
>> friday
>> 0.8
>> Virginie Rose
>> saturday
>> 0.8
>> David Brown
>> saturday
>> 0.7
>> Brian Yellow
>> monday
>> 0.55
>> Tom Black
>> thuesday
>> 0.4
>
>
>
> ------------------------------------
> Posted by: Thierry Blanc <[email protected]>
> ------------------------------------
>