Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Unix question
You cannot ...i least I think you can't ... you see, sed parses each
line independently once and only once, looking for certain patterns ..
this is what makes it so fast... so I believe that "the last line" is an
unknown entity to sed pattern recognizer (pun intended). (If I'm wrong
please correct me - it's been a while :S)
I would recommend editing it with VI (as shown below) or using AWK or
Perl.
Or .. you could always apply quotes to all the lines, and then edit out
the last one :P
In VI
:%s/^/\'/g
]]x
HTH
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of
manoj.gurnani_at_polaris.co.in
Sent: Sunday, March 07, 2004 11:28 PM
To: oracle-l_at_freelists.org
Subject: Unix question
Importance: High
Hi,
I want to put a single quote before each line except last line
Using sed filter .
I want this in a single expression.
How can I achieve the desired o/p.
Thanks
Manoj
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlReceived on Tue Mar 09 2004 - 01:52:49 CST
-----------------------------------------------------------------
![]() |
![]() |