Home » SQL & PL/SQL » SQL & PL/SQL » Read content from file in Unix
Read content from file in Unix [message #222987] Wed, 07 March 2007 02:22 Go to next message
hellomanish
Messages: 1
Registered: March 2007
Junior Member
Hi All,

I need to prepare shell script which will fetch the data between Message Start and Message End. This Block can come multiple time. I was to read all.
Also the condition is i want to read last block first.

Here is sample files: name abc.log

AAAAAA
BBBB
Message Start
XXXXXXXXXXXXXXXXx
YYYYYYYYYYYYYY
ZZZZZZZZZZZZZZ
Message End

AAAAAA
BBBB
Message Start
111111111111111111
XXXXXXXXXXXXXXXXx
YYYYYYYYYYYYYY
ZZZZZZZZZZZZZZ
Message End

AAAAAA
BBBB
Message Start
22222222222222222
XXXXXXXXXXXXXXXXx
YYYYYYYYYYYYYY
ZZZZZZZZZZZZZZ
Message End


I want to extract data between Message Start And Message End.

kindly let me know how to do it. Thanks in Advance.

Regards,
Manish
Re: Read content from file in Unix [message #222991 is a reply to message #222987] Wed, 07 March 2007 02:25 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Assuming this is to be read out of a file on Disc, you will be wanting to read up about UTL_File, SQLLoader, or External Tables.
Previous Topic: comma seperated input string to number
Next Topic: need a dummy column
Goto Forum:
  


Current Time: Sun Dec 11 08:31:17 CST 2016

Total time taken to generate the page: 0.23127 seconds