On 13.06.2013 00:52, Janis Papanagnou wrote:
> On 13.06.2013 00:15,
ehabaz...@gmail.com wrote:
>> I need to replace a string within a range of lines starting from finding a mark(another string).
>>
>> change "\xe2\x80\x8f" with "?" of lines 1,12 after finding a string "BarCode"
>
> (Assuming by "after" you mean starting _the *line* after_ the match.)
>
>>
>> sed -e "/BarCode/,12s/\xe2\x80\x8f/?/g" hold.out > soh.txt
>>
>
> This is an awk newsgroup, so here's an awk solution...
>
> awk 's&&s--&&sub(/\xe2\x80\x8f/,"?");/BarCode/{s=12}'