Extracting with sed

Hi all,

i have a log file which consits of the below text

SQL> @.[%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

Try

sed -e "s;.*\[\(.*\)\].*$;\1;g" yourlogfile.log > yourfilelist

HTH
JG

Your requirement changed so this won't work. Sorry!

Try this:

sed -n '/\]"$/s/.*\[\(.*\)\].*/\1/p' file > newfile

This is not working

Works fine for me:

$ cat file
SQL> @.[%OSAUTH_PREFIX_DOMAIN%]
SP2-0310: unable to open file ".[FALSE]"
SQL> spool off
$
$ sed -n '/\]"$/s/.*\[\(.*\)\].*/\1/p' file
FALSE
D:\bfx_db>sed -n '/\]"$/s/.*\[\(.*\)\].*/\1/p' test.sql > testout.sql
sed: -e expression #1, char 1: Unknown command: `''

We are Using sed on windows