Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Unix - Nth occurance search in vi

Unix - Nth occurance search in vi

From: Martin, Alan <Alan.Martin_at_GMACInsurance.com>
Date: Tue, 29 Aug 2000 12:54:47 -0400
Message-Id: <10603.115755@fatcity.com>


I can't figure out how to find the Nth occurance of some hex value using the substitute command. Suppose I have the following line:

ABCxDEFxGHIxMNO

Assume each "x" above is a hex 7F ( in vi it shows up as a '^J' ). I want to remember everything up to the 3rd occurance of "x", then insert "JKLx", and follow it with the remainder of the line to produce:

ABCxDEFxGHIxJKLxMNO

I want to do something like:
s/\(.*x\)\{3\}/&JKLx/

What Ctrl-V sequence produces a hex 7F?
and
How do I search for the Nth occurance of it?

Thanks,
Alan Martin
Database Administrator
GMAC Insurance Personal Lines
Winston-Salem, NC
Alan.Martin_at_GMACInsurance.com



Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.
Received on Tue Aug 29 2000 - 11:54:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US