Afficher un message
Vieux 23/05/2007, 16h15   #3
Janis Papanagnou
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: extract lines from file

Michael Tosch wrote:
> surajkumar1@gmail.com wrote:
>
>> Hi Friends,
>>
>>
>> I posted this questions few hours back and got some replies also but
>> it's not opening.
>>
>>
>> I want all those lines lines from file starting with keyword 'INSERT'
>> and end with ')'
>> Note: In following example there are two ')' (one after 'INSERT' and
>> another after 'VALUES') . I want all those lines between INSERT and
>> second occurence of ')'

>
>
> Why not everything between INSERT and first following )
> and everything between VALUES and first following )
> ?


That's actually what my proposed solution was based upon;

awk '/INSERT/,/\)/;/VALUES/,/\)/'

that's two independent pattern ranges, each printing as default the
complete matching block.

>
> The result should be the same.
>
>


Janis
  Réponse avec citation
 
Page generated in 0,04664 seconds with 9 queries