Re: extracting with sed
From: Stefan Moeding <dba_at_moeding.net>
Date: Fri, 05 Feb 2010 18:23:48 +0100
Message-ID: <87wryriokb.fsf_at_esprit.moeding.net>
Hi,
Date: Fri, 05 Feb 2010 18:23:48 +0100
Message-ID: <87wryriokb.fsf_at_esprit.moeding.net>
Hi,
Mohammed Mehraj Hussain writes:
> SQL> _at_.[%OSAUTH_PREFIX_DOMAIN%]
> SP2-0310: unable to open file ".[FALSE]"
> SQL> spool off
>
>
> From this file i need to extract the text from the second line in between []
> (i.e) False and need to put this output to a another file...
>
> How can i do this with SED command
The following should do it:
sed -ne '/^SP2-[0-9]*:/s/^\(.*\[\)\(.*\)\(\].*\)$/\2/p' /tmp/f.log
It looks for a line starting with SP2 and a number, breaks that in three parts by taking [ and ] as delimiters and prints the second part.
Regards,
Stefan
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Feb 05 2010 - 11:23:48 CST