"Radoulov, Dimitre" writes:

> "tester" wrote in message ...
>> Hi Gurus,
>> I have a file with thousand lines following format:
>> a: b=test,c=get,d=tom
>> 1: b=test2,c=get2,d=tom2
>> a: b=test3,c=get3,d=tom3
>>
>> I need to grep for each line with start with a: and replace c with CA
>> only.

>
> sed '/^a:/s/c/CA/' infile


It might be safer to use:

sed '/^a:/s/,c=/,CA=/'
as it won't change 'c' if it happens to appear in value.

--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +-------ooO--(_)--Ooo--