Select a string from beginning random position with a specific set of characters

Hello everyone, here is my database information:

Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE Production 11.2.0.3.0
AMT for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

I'm trying to find a way to do something like that.  Say I have a string in the middle of a string I need to extract.   For example:

(1) 8781FAHH911122as3_2

(2) 877aa-FAHHa222xa342_1

(3) F_FAHH10aa49933

(4) FAHH123412341R

(5) FAHH457894126

What I want to it would be whatever it either starting from the FAHH and the 9 digits after so for the above, I would like to:

(1) FAHH911122as3

(2) FAHHa222xa342

(3) FAHH10aa49933

(4) FAHH123412341

(5) FAHH457894126

I looked at using left/right/substring but my problem is that the part I want could be in a place randomly within the chain, so I can't designate a starting position.

Any help would be greatly appreciated.

Thank you

-Steve

switbeck wrote:

Hello everyone, here is my database information:

Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE Production 11.2.0.3.0
AMT for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

I'm trying to find a way to do something like that.  Say I have a string in the middle of a string I need to extract.   For example:

(1) 8781FAHH911122as3_2

(2) 877aa-FAHHa222xa342_1

(3) F_FAHH10aa49933

(4) FAHH123412341R

(5) FAHH457894126

What I want to it would be whatever it either starting from the FAHH and the 9 digits after so for the above, I would like to:

(1) FAHH911122as3

(2) FAHHa222xa342

(3) FAHH10aa49933

(4) FAHH123412341

(5) FAHH457894126

I looked at using left/right/substring but my problem is that the part I want could be in a place randomly within the chain, so I can't designate a starting position.

Any help would be greatly appreciated.

Thank you

-Steve

You would like to add Instr. If you'd a SUBSTR with a nested INSTR to find your starting point to start the substring.

You can also use regular expressions, but they are quite CPU Melow

See you soon,.

Tags: Database

Similar Questions

  • Hello! Pro iPad comes with a specific set of fonts in Keynote? Or is it possible ad fonts, for example with the font book?

    Hello! Pro iPad comes with a specific set of fonts in Keynote? Or is it possible ad fonts, for example with the font book?

    This is a list of the fonts installed in iOS 7, as far as I know, it has not changed for iOS 9.

    iOS 7: List fonts - Apple Support

    Fonts are embedded in the iOS, a few Apps will bring new fonts when loading the application. Keynote will use those that are pre-loaded with iOS. There are third-party fonts that can be installed, but you will need to check that they are working with the speech of the seller of these fonts.

  • If the synchronization from a laptop computer with its own set of bookmarks, that occurred in the original portable bookmarks? Also, are they saved?

    I'm afraid to lose a set, different bookmarks on a laptop during the synchronization of your desktop set. How Firefox handles Favorites the?

    Techguy, you are right. The design principle is that you want to have your Firefox in sync... all this.

    In case you also describe, all L - O of bookmarks would appear duplicated after that second machine is associated. As soon as you remove them a machine that they will disappear from it too.

    I hope that makes sense.

  • Problem with customization specifications setting Administrator Password Manager

    I have two problems.

    I have a model R2 Windows Server 2012 in a vCenter 5.1 (Build 1123961) environment. I created a vSphere Client Windows customization feedback, however, (and the main issue) I notice that it does not have the administrator password to what I entered after it don't this is sysprep deployment of a model.

    I've created a script around to do this, which works very well, unless I experience my second question. When customization is started, it creates the event "vim.event.Customization.StartedEvent". He is then supposed to create the 'vim.event.CustomizationSucceeded' event once it has successfully managed the customization, including the command sysprep (and setting the password). Occasionally, but does not trigger the event "vim.even.CustomizationSucceeded" until the days or weeks after the initial event of beginning of customization, which will cause the sysprep crush my difficulty scripts and not allow me to log in under the administrator because of the question first, main account.

    Any thought to why sysprep does not have the administrator password to what I specified in the customization of the OS? Or why the successful event of customization does not always raise after it was launched (in minutes and not days/weeks)?

    I ask just once more: the administrator password model guest empty OS?

    vSphere 5.5 Documentation Centre : you can change the administrator password if the password for administrator on the Windows virtual machine is empty. If the model or the Windows virtual machine already has a password, the administrator password does not change.

  • Select the string table drop-down list box.

    Hi all

    I want to select the combo box list based on a string in the entry, I don't know how to do this. I have a drop-down list box and the value comes from a database, what I want to do is I want to change the value of the selected box based on the existing value in the database drop-down list. for example, A, B, C D I strings in the drop-down list box, and then in my database, I have a field with the string C, I want to change the C to A. I can't enter the value of C in a string format, but I don't know how to be the first position of the drop-down list box in so the order of channels combo box will be C, A, B, d., the value of C

    Thank you

    Then just write a new array of strings, with the elements of the new agenda, to the "[] strings" - property.

    Either you must code something that allows you to create an array of strings with the elements in the order that you want them to be. If there is a reorganization only, you could do something like:

    -Get the array of strings [] from the drop-down list using a property node box.

    -Find the position of the element you want to place first and use "delete from table", which returns the new array and the element removed.

    -Build a new table 1 d of the deleted item and table remaining. Move to the second combobox Strings [] property of a node property.

  • Generating random numbers with format 18XX88YYYYY

    I've been tryig to generate random numbers with
    format 18xx88yyyyy
    here
    18, followed by two random number then 88 followed by five random number. Here 18 and 88 are set to place one, two, five and sixth position.

    but I am unable to get the logic.

    So please help


    Thanx

    Achyot

    Try this:

    SELECT    '18'
           || ROUND (DBMS_RANDOM.VALUE (1, 100))
           || '88'
           || ROUND (DBMS_RANDOM.VALUE (1, 100000))
      FROM DUAL
    

    - - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev a. (10g OCP)
    http://kamranagayev.WordPress.com

  • I get random stops with my recordings on Widows Media Center.

    Original title: Smart TV with Windows Media Center Recordings interference

    Since the installation of a new Samsung Smart TV (model UN46ES8000F) I have been making random stops with my recordings on WMC.  Because there are a lot of tuners and available memory at the time where the records are arrested, they record not 'conflicts' in the sense of the WMC.  Records are simply stopped manually at random times when recording provided by another component on my computer in the home network. Today, I tried to reload WMC, a full charge of Windows 7, complete diagnosis on all equipment running & exchanging a few components; But starting today, I was not able to specifically identify the component that prevents the records, however, I begin to suspect the smart terminal on the new TV.  I have photos available of history showing the partial records should anyone want to consult them.

    Description of the system: I use wired (Cat5E) Linksys DMA 2000 ex distribution TV recorded on my first HDHomeRun in 4 different rooms in my house since my computer Dell XPS420 (under Windows 7 Ultimate) via a D-link DGS-2205 gigabit switch.  The Smart TV is connected to the internet via my router D-link DIR - 655 Wireless-N.

    Everyone knows about this problem, and no one knows a way to solve it?  Do not hesitate to contact me directly at * address email is removed from the privacy *.

    I too began to see problems with my Windows 7 Media Center after buying a "smart tv".

    I am using an HDHomerun Prime with 2 pc for more than a year and practically no problem.  Now, I use it with a Ceton Extender so... no problem.  But when I got my first smart (a 55 '' TV LG LED 120 MHz) model, the problems started.

    Whenver my new flat screen is connected to my network (cat6, 1000Mbps), I noticed a ton of problems with my 3 tuners.  All three tuners "disappear" and whatever program I was watching would freeze.

    I didn't record something while my smart tv is connected to my network, so I can't say I have the same problem you are having, but I sincerely believe that we are the same.  For the sake of arguments, if I recorded something, it probably would have stopped.

    I agree with you 100%.  I think the smart TV is guilty.  I think the problem is our TV are the first hdhomerun and treat it as one product DLNA.  Under my smart TV App menu, I can see the shared folders on various pc's on my network (music, videos, etc.). .. as well as three files for each tuner hdhomerun main!  When I click on one of the tuner, my TV resets icon.  Something tells me that when the smart tv is connected to my home network, he's trying somehow communicate with three tuners and which is originally the tuners to freeze.

    If Silicondust would somehow a patch update or firmware to avoid the first appearing as a product DLNA, which can solve our problems.

    I think that Silicondust would be able to help you with this problem.  I doubt that microsoft technicians will have a clue.

    The silicondust techies will be most useful, especially since they want to certify our hdhomerun first tuners like DLNA Certified products as we speak.   If you do a search on the web for first hdhomerun and DLNA, you will see an article/news update on progress.

  • separate strings from a long list

    Hello

    I'm trying to get distinct values in a list of strings separated by commas.

    for example,.

    Select distinct ename from emp

    where instr ("BLAKE, CLARK, JONES, SCOTT, BLAKE CLARK, JONES, SCOTT, BLAKE CLARK, JONES, SCOTT, BLAKE")

    CLARK, JONES, SCOTT, BLAKE, CLARK, JONES, SCOTT, BLAKE, CLARK, JONES, SCOTT, BLAKE, CLARK, JONES, SCOTT, BLAKE ', ename) > 0;

    It gives the result. When there are huge name lists (which is more than 4000 bytes) it gives the error as "string literal too long."

    How to get distinct values in a long list.

    Any help would be great. I tried with regexp_substr and also the function TABLE (comma_to_table. everything works for the list with 4000bytes and below.)

    Nothing is taking the long list of the values of more than 4000 bytes. Help, please.

    Thank you

    KJ

    An iteration to create your lists is not the most effective approach, I personally use listagg and chunk 4 k of lists, but I'm so busy, as a quick solution for you, try the following...

    create or replace function 'GET_EMPNAMES' (SERIALNUM in number) return as clob

    V_NM CLOB: = ' ';

    cursor C is

    Select distinct ENAME

    from EMP

    where SNO = SERIALNUM;

    Start

    for CAASS in C

    loop

    V_NM: = to_clob (AHACS. ENAME | ',') || V_NM;

    end loop;

    Return V_NM;

    end;

    create or replace 'GET_FILTERED_NMFN' (FILTERED_NAMES in clob) return clob is

    LIST_OF_NAMES CLOB: = ' ';

    ALLNAMES cursor is

    Select distinct E.ENAME

    EMP e

    where INSTR (FILTERED_NAMES, E.ENAME) > 0;

    Start

    I'm in ALLNAMES

    loop

    LIST_OF_NAMES: = to_clob(I.ENAME ||) ',' )|| LIST_OF_NAMES;

    end loop;

    Return LIST_OF_NAMES;

    end;

  • connection for printing from a computer wireless with a connection cable to the router usb printer?

    Produst name: HP Officejet Pro L7555.

    Works with Windows 7.

    A new router and the modem was installed when Comcast installed our wireless connection.  This of course did not work with the current setting of the printer.  The printer is connected via USB cable to the router.

    Are you sure it's a USB and not an Ethernet cable?  I bet it's in the affirmative:

    1. disconnect the Ethernet cable.

    2. on the printer: Setup > network > default settings.

    3 reconnect the Ethernet.

    Now, remove the printer in Control Panel > devices & printers, then add it again like this:

    1. make sure the printer is on and connected to your network. Verify that you can access the printer's internal web page by accessing its IP address before continuing. Get his IP address for a network Test printed on the front of the printer.
    2. click on > start > Control Panel > devices & Printers.
    3. click on add a printer
    4. Select local printer
    5. Select create a new port and select Standard TCP/IP Port, and click Next.
    6. under device type, select TCP/IP Device. Under the name of host or IP address, enter the IP address of the printer. Click Next.
    7. Select Hewlett-Packard in the list of manufacturers and select and select your printer model. Click Next.
    If your printer model is not in the list, then select disk provided, browse the CD that came with your HP printer and select the first file begins with hp and ending with INF. click Open, then OK. Select your printer model. Click Next.
    8. If prompted, use the driver that is currently installed.
    9. He will ask the name of the printer - enter a new name or use the one existing. This will be the name of the printer that you select from other applications.
    10. we may ask you to share the printer. Choose No.
    11. the printing area of Test Page is displayed. Go ahead and print it out.
    12. click on finish.

  • How to type vertical text from the bottom up with the right orientation for a graph?

    How to type vertical text from the bottom up with the right orientation for a graph?

    Hello! Below, I'll demonstrate how to have vertical text in two different ways.

    Example 1:

    1. below, I have a graph and want to label the vertical axis.

    Select the text tool, and then the Vertical text tool.

    2 with the vertical Type tool, I tap on my vertical label.

    3 with the move tool, then I can orient the text in a position desired, as shown in the examples below.

    If this isn't the desired orientation of the vertical type you would like. I have the example 2 below.

    Example 2:

    1. After typing my text vertically with the Vertical Type tool (in example 1), I want to move to a horizontal position. I can go up to the options panel and select the icon "show/hide text orientation", surrounded by below. It will pass the text back and forth between vertical and horizontal.

    2 after the passage of the text to be horizontal, I want to change the orientation of the text, so it is aligned with my vertical axis.  Go in Edit > transform > Rotate as shown below.

    3 you want to can Rotate the text as indicated below.

    4 text is not in the right position we want, so we have to move the text, as illustrated below. Press enter/return to perform the complete transformation.

    5. the text is shown below.

    Other links:

    Please post back with any questions,

    Janelle


  • Ask the glossary of words beginning with a specific letter

    I have a page which is a glossary of terms. This is a table of 2 field.  Word and definition.  Is there a way to pull all the words beginning with a specific letter?  How complicated this request would be?

    Select * from mytable where the word like 'a % '.

  • When I type or paste a URL into the address bar or select a url from the address bar dropdow, the "enter" button does nothing. I have to press the green arrow to load the url?

    Each time it manually to enter a url, past a url, or select a url from the address bar, the system requires that I click on the green arrow to go to the url. The entrance to key doe nothing. Am I the only one having this problem?

    This problem may be caused by an extension (possibly AVG Safe Search) which does not work properly.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

    If this does not work in mode without failure, then disable all extensions and then try to find out who is the cause by allowing both the problem reappears.

    • Choose "Disable all add-ons" on issues to troubleshoot Firefox in Safe Mode to set window to disable all extensions.
    • Close and restart Firefox after each change through "file > exit ' (Mac: ' Firefox > leave";) Linux: "file > exit ')

    In Firefox 4, you can use one of them to start in the questions to troubleshoot Firefox in Safe Mode:

    • Help > restart with disabled modules
    • Hold down the SHIFT key while double-clicking the shortcut from the desktop Firefox (Windows)
  • How can I selectively transfer files from an iMac 2009 to a new iMac in 2015? The two running os 10.11

    How can I selectively transfer files from an iMac 2009 to a new iMac in 2015? The two running os 10.11.3.

    I do it with a G4 OS Tiger and the Mavericks MacBook by plugging into an Ethernet jack on my router and by enabling the sharing of files on the G4 in System Preferences > sharing.  If items are placed in a folder called 'Public', it can be read by anyone on the network by logging in as a guest. Otherwise, if I login with my user ID on this computer I get access read/write for all of my folders.

  • Tension running from negative to positive to a negative value again using a structure case

    Hello

    I a VI that takes place (not shown) DAQ hardware and want to do the following with it:

    By feeding the starting value (the maximum negative value of voltage), increase (positive) and the end value (maximum positive) voltage for the DAQ hardware TRADERS (should be

    shown in the digital display) should go to gradually change from negative to positive maxima and do the reverse process of return to the starting value

    which is the maximum negative value.

    for example

    If I put - 3V to the starting value, 0.5 as increment, + 3 V to the end value, I should get the following:

    -3, -2,5, 2,...,.0,..., 2.5, 3 and then 2.5, 2..., 0,...,-2, 2.5-3, then stops.

    I managed to get the first which is negative to positive Maxima but he never do otherwise. Can anyone help with this.

    Thank you very much

    Alain

    Study the attached example.  Instead of having just a graph showing each DC voltage at each iteration, I made a graph that will update to show all the steps as they occur.  The waveform that is the scale of things is to properly size the chart so you can see each stage without having the graph resize with each iteration of the loop.  You can pass values to your DAQ hardware to get the real exit.

    I used a second shift for such direction suggested by Altenbach register.  It is to go to the best (maybe the only way).

  • How to convert times from second to hh with CVI

    How to convert times from second to hh with CVI?

    Can anyone advice?

    It's here. As I told you, it's very simple:

    //----------------------------------------------------------------------
    // Function secToHMSstring ()
    //----------------------------------------------------------------------
    /// HIFN secToHMSstring ()
    /// HIFN The function takes an amount of seconds and returns a string with
    /// HIFN the corresponding value in H:M:S format
    /// HIPAR sec/Value in seconds to convert
    /// HIPAR verbose/If True use "hms" separators; if not, use ":" separator
    /// HIPAR string/The output string. It is responsibility of the programmer
    /// HIPAR string/that the string is large enough to keep the resulting text
    /// OUT string
    void secToHMSstring (int sec, int verbose, char *string)
    
    {
        int     hh = 0, mm = 0, ss = 0;
    
        if (sec >= 3600) {
            hh = sec / 3600;
            sec -= hh * 3600;
        }
        if (sec >= 60)
            mm = sec / 60;
        ss = sec - mm * 60;
    
        strcpy (string, "");
        if (verbose) {
            if (hh > 0) sprintf (string, "%s%dh", string, hh);
            if (mm > 0) { if (strlen (string)) strcat (string, " "); sprintf (string, "%s%dm", string, mm); }
            if (ss > 0) { if (strlen (string)) strcat (string, " "); sprintf (string, "%s%ds", string, ss); }
        }
        else {
            if (hh > 0) sprintf (string, "%s%d:", string, hh);
            if (mm > 0) {
                if (strlen (string)) sprintf (string, "%s%02d:", string, mm); else sprintf (string, "%d:", mm);
            }
            else if (strlen (string))
                strcat (string, "00:");
            if (strlen (string)) sprintf (string, "%s%02d",  string, ss); else sprintf (string, "%d", ss);
        }
    
        return;
    }
    

Maybe you are looking for