By selecting the rope between some special characters

Dear Senior
Please guide me how to select the string from - channel selection - behind the edge-
I mean I want to select the channel of the first indent of before the second indent
example of
1-OS MARKING-1072
2 BONE POCKET TIE-1288
3-OS ATTACH A-1073
4-OS CUP-1128
5-OS ATTACH B-1075
POCKET 6 OS O/L-976
7 REGULUS SLEEVE O/L-1221
8-ARMHOLE F/L-804
9-CARD MAKING-819
10-BADGE TIE-820
Result
BONE MARKING
OS LOCK TIE
BONE JOIN
CUTTING OF THE BONE
BONE TIE B
POCKET OS O/L
REGULUS SLEEVE O/L
ARM HOLE F/L
BADGE MANUFACTURING
BADGE TIE

Hello

Use INSTR and SUBSTR, like this:

WITH     got_pos     AS
(
     SELECT     str
     ,     INSTR (str, '-', 1, 1) + 1     AS start_pos
     ,     INSTR (str, '-', 1, 2)           AS end_pos
     FROM     table_x
)
SELECT     SUBSTR ( str
            , start_pos
            , end_pos - start_pos
            )       AS between_hyphens
FROM    got_pos
;

You can also use regulat expressions, but they will be slower.
In Oracle 10.1 (and), for example:

SELECT     REGEXP_REPLACE ( str
                 , '^[^-]*-([^-]*)-.*'
                 , '\1'
                 )     AS between_hyphens
FROM    table_x
;

From Oracle 11.1, you can also use REGEXP_SUBSTR.
Again, it will be less effective than using SUBSTR and INSTR.

I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
Explain, using specific examples, how you get these results from these data.
What do you do if the string does not contain 2 hyphens? If thiis is a problem, then include examples in your sample data and results.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum {message identifier: = 9360002}

Tags: Database

Similar Questions

  • Column header in the interactive report with special characters

    Interactive column heading in the report sorting and filtering is broken when I used special characters in it.

    Column sorting options appear in the wrong place and the page becomes unresponsive.

    Cause: I use a slash "/" in my query and who broke it. I tried ampersand and the same problem exists.

    Query: Select project name, status ' Open/closed' projects;

    This problem does not exist in the classical report, but only in interactive report

    Version: Apex 4.2.4

    Here's a demo app with the problem I'm talking about. Trying to sort the column entitled ' open/closed '.

    http://Apex.Oracle.com/pls/Apex/f?p=12289

    U:testuser

    P:test

    The issue is identical to an another forumn.

    https://community.Oracle.com/message/11156426

    However, I have just created this new discussion with the hope that this minor bug might be fixed in the next version of the apex.

    During this time, no workaround or suggestions are welcome.

    I tried to make the column "Remove HTML and special characters", but that did not help. I think I have a header of column with some special characters is a pretty basic requirement apex should support.

    Hello

    I guess simple fix is that not not to use the query column aliases where is /.

    But you can use ' Open/closed' as an attribute of the column header.

    Kind regards

    Jari

  • Decode the help of HTML special characters

    Hello

    I use a BrowserField to see others come from HTML content via the server.

    But the data being sent is encrypted (with special characters as "< p & gt")

    So I think I must decode before moving on to the BrowserField.

    Can someone offer me please how to decode?

    See you soon

    http://supportforums.BlackBerry.com/T5/Java-development/BrowserField-help/m-p/1175777#M163832

  • Allow the user to update the fields between some time. If not just to see

    Hi Experts,

    I was thinking about the following example. Can I know how can I implement this in project web ADF.

    Allow the user to change the shape of the page on some time interval of time rest allows them to view only. I can put this check in time of connection or the loading of the page. How ever how to apply this connection between the cut-off time. Can I disconnect all users of the system to time limits and ask them to re-login again. In the affirmative. How to implement that.

    Thank you.

    t

    A brainstorm of my response, possibly other posters will give a better answer...

    Is the requirement actively disconnect everyone once the time-out occurs, or can at least delay to the next request for each client?

    If the old I suggest to use some sort of component Ajax poll on the page that keeps checking with the server if the delay has occurred. Maybe later if a Java EE filter or listener to detect the expiration time. In both cases once the delay has occurred to redirect the user to the adfAuthentication servlet will disconnect the current session/user.

    CM.

  • Select the text between 2 bookmarks with Javascript

    I'm trying to select text between 2 bookmarks. Now, I have this:

    var doc = app.activeDocument;

    var BB = doc.bookmarks.firstItem ();
    var be = bb.bookmarks.firstItem ();

    bb.showBookmark ();
    var en = app.selection [0];

    be.showBookmark ();
    var to = app.selection [0];

    bb.showBookmark ();

    App.Select (app.selection [0].parentStory.insertionPoints.itemByRange (fr.index, to.index));

    This code does not work if bookmarks are on different pages.

    Any suspicion that must go in the call to app.select ()?

    What is the best way of art. to understand the DOM who uses app.select ()?

    This code does not work if bookmarks are on different pages.

    But it did, perfectly. I suspect that there is another problem.

    What is the best way of art. to understand the DOM who uses app.select ()?

    App.Select works as manually select the text. I think the underlying problem is that the text is not just "on pages", which is * not * a problem, but it's actually separate two stories. A script can only select contiguous text of the same story (a unique set of images of text block), just like you cannot select all the text in two unconnected blocks of text.

  • By selecting the difference between two images

    Hello

    I have two photos exactly the same thing that I took using a tripod, studio lighting and general conditions. However, in the second photo, I inserted a subject - in this case a sculpture complex. Photoshop can merge these two images together AND choose so the difference between the two images - in this case the sculpture complex?

    Basically, I need to select the sculpture and do not want to spend time manually selecting due to its complexity. I need to separate the background and the sculpture for editing on their own layers.

    Thank you

    Stephen-CS3

    You posted this in the two forums, its been answered in the mac forum.

  • Select the mountains between two dates

    Hi all
    How can I select all months between two dates. For example, if two dates are say 2008-05-25 and 2009-07-15, then I need following output

    May-2008
    June-2008
    July-2008
    August-2008
    September-2008
    October-2008
    November-2008
    December-2008
    January-2009
    February-2009
    March-2009
    April-2008
    May-2009
    -June 2009
    July-2009

    Thank you
    Sujnan

    Try this one

    SQL>  SELECT TO_CHAR(add_months(TRUNC(to_date('25/05/2008','DD/MM/YYYY'),'MM') ,(level-1)),'fmMonth-YYYY')
      2     FROM dual
      3    CONNECT BY level <= months_between(to_date('15/07/2009','DD/MM/YYYY'),to_date('25/05/2008','DD/MM/YYYY')) + 2;
    
    TO_CHAR(ADD_MO
    --------------
    May-2008
    June-2008
    July-2008
    August-2008
    September-2008
    October-2008
    November-2008
    December-2008
    January-2009
    February-2009
    March-2009
    
    TO_CHAR(ADD_MO
    --------------
    April-2009
    May-2009
    June-2009
    July-2009
    
    15 rows selected.
    
    SQL> 
    
  • How to save the string in a file with some special characters

    Hello

    I m using MD5 - llb to create a password.

    So, I want to save this MD5-string to a file and read it later abd compared again.

    Works perfectly with a proplem:

    Some Word create a '\r' in the string of MD5 and when I save this string in a file and read it at the time its read as a '\n' for the comparison does not work.

    My question is: How can I record a string exactly as if it were somewhere and read back (also the invisible characters)

    For example, the word: heinz

    is in MD5: \r\FB^\07\A6\07T\C7\D9\C2\94\AB\C9\1DS\95 (string as display codes indicator)

    When I save the string in a file, then I rerad back: \n\FB^\07\A6\07T\C7\D9\C2\94\AB\C9\1DS\95

    I used the "write text file" and "read text file".

    What should I use to record and play back the same thing?

    THX

    Have you tried right click and deselection "convert EOL?

  • Problem to browse to files in the page with the text field with special characters

    Hello.
    I have a very interesting thing happening in my APEX (4.0.1) application.

    I have problems with a text field, because when I insert the text 'aaaaa' and send the page, the text is transformed in "Aaa£ aa.
    After some time trying to understand the game characters and translations and etc, I realized that this thing happened in some pages.

    Then, I started to remove components of the page where it happens and I discovered that what initially is an element to browse file...
    Every time I have send the page, if there is an element of browse file created on the page, the text is changed. If I delete the queue item browse, when submitting the page, the text remains correct.

    Is it supposed to work like this? And if yes, why is it?

    Thank you.
    vssantos

    Published by: vaissantos on April 1st, 2011 22:45

    Is it supposed to work like this?

    No, of course not.

    Of one of your previous posts, it seems that you use the APEX? If so, similar problems have been reported a number of times before: + {: identifier of the thread = 1104224} + suggests a fix.

  • Run as administrator does not not for files bat inside the folder names with special characters such as)

    Dear all,
    I am unable to run any file beats with "Run As Administrator" when the bat file is present in a folder that has (in his name.
    For example: I main.bat in d:\test (_8july) \main.bat.
    The content of main.bat is like that.

    c:\windows\system32\cmd.exe /C "e:\test.bat."

    The content of test.bat is like this:

    echo 'test' > %temp%/test.txt
    pause

    If I double-click main.bat, I can see the file text.txt being created and 'test' written in it.
    If I click with the right button on main.bat and select 'Run as administrator', cannot run the file beats and I get the error "d:\test" is not a recognized command.
    How to handle these situations?

    If I run as c:\windows\system32\cmd.exe /C 'd:\test (_8july) \main.bat' to 'Run' in Start menu cannot run little. It gives the same error "d:\test" is not a recognized command.
    If I run as c:\windows\system32\cmd.exe /C "" d:\test (_8july) \main.bat"" it can work and works very well.
    So, the question is when we choose 'Run as Administrator', it takes the file bat as insead "d:\test (_8july) \main.bat" of ""d:\test (_8july) \main.bat" is there a work around for UAC, we can pass the correct string

    Thanks in advance
    Rambeau

    Hi Raghu,

    Your question of Windows is more complex than what is generally answered in the answers from Microsoft Windows Vista forums. It is better suited for the IT Pro TechNet public. Please ask a question in theForums of Scripting on TechNet

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Simply select the values between min and max of a value accumulated during the day

    Hello Forum,

    a value is accumulated more a day and over a period of time. The next day, the value is reset and starts to build up again:
    with sampledata as (select to_date('09.09.2012 00:04:08', 'dd.mm.yyyy hh24:mi:ss') ts, 120 val from dual union all
                       select to_date('09.09.2012 01:03:08', 'dd.mm.yyyy hh24:mi:ss') ts, 120 val from dual union all
                       select to_date('09.09.2012 02:54:11', 'dd.mm.yyyy hh24:mi:ss') ts, 120 val from dual union all
                       select to_date('09.09.2012 03:04:08', 'dd.mm.yyyy hh24:mi:ss') ts, 120 val from dual union all
                       select to_date('09.09.2012 04:04:19', 'dd.mm.yyyy hh24:mi:ss') ts, 120 val from dual union all
                       select to_date('09.09.2012 05:04:20', 'dd.mm.yyyy hh24:mi:ss') ts, 120 val from dual union all
                       select to_date('09.09.2012 06:12:02', 'dd.mm.yyyy hh24:mi:ss') ts, 23 val from dual union all
                       select to_date('09.09.2012 07:12:03', 'dd.mm.yyyy hh24:mi:ss') ts, 29 val from dual union all
                       select to_date('09.09.2012 08:12:04', 'dd.mm.yyyy hh24:mi:ss') ts, 30 val from dual union all
                       select to_date('09.09.2012 09:12:11', 'dd.mm.yyyy hh24:mi:ss') ts, 45 val from dual union all
                       select to_date('09.09.2012 10:12:12', 'dd.mm.yyyy hh24:mi:ss') ts, 60 val from dual union all
                       select to_date('09.09.2012 11:12:13', 'dd.mm.yyyy hh24:mi:ss') ts, 75 val from dual union all
                       select to_date('09.09.2012 12:21:24', 'dd.mm.yyyy hh24:mi:ss') ts, 95 val from dual union all
                       select to_date('09.09.2012 13:21:26', 'dd.mm.yyyy hh24:mi:ss') ts, 120 val from dual union all
                       select to_date('09.09.2012 14:21:27', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('09.09.2012 15:21:30', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('09.09.2012 16:21:32', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('09.09.2012 17:21:33', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('09.09.2012 21:21:33', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('09.09.2012 23:21:33', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('10.09.2012 00:04:08', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('10.09.2012 01:03:08', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('10.09.2012 02:54:11', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('10.09.2012 03:04:08', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('10.09.2012 04:04:19', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('10.09.2012 05:04:20', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('10.09.2012 06:12:02', 'dd.mm.yyyy hh24:mi:ss') ts, 14 val from dual union all
                       select to_date('10.09.2012 07:12:03', 'dd.mm.yyyy hh24:mi:ss') ts, 34 val from dual union all
                       select to_date('10.09.2012 08:12:04', 'dd.mm.yyyy hh24:mi:ss') ts, 58 val from dual union all
                       select to_date('10.09.2012 09:12:11', 'dd.mm.yyyy hh24:mi:ss') ts, 70 val from dual union all
                       select to_date('10.09.2012 10:12:12', 'dd.mm.yyyy hh24:mi:ss') ts, 120 val from dual union all
                       select to_date('10.09.2012 11:12:13', 'dd.mm.yyyy hh24:mi:ss') ts, 142 val from dual union all
                       select to_date('10.09.2012 12:21:24', 'dd.mm.yyyy hh24:mi:ss') ts, 153 val from dual union all
                       select to_date('10.09.2012 13:21:26', 'dd.mm.yyyy hh24:mi:ss') ts, 153 val from dual union all
                       select to_date('10.09.2012 14:21:27', 'dd.mm.yyyy hh24:mi:ss') ts, 153 val from dual union all
                       select to_date('10.09.2012 15:21:30', 'dd.mm.yyyy hh24:mi:ss') ts, 153 val from dual union all
                       select to_date('10.09.2012 16:21:32', 'dd.mm.yyyy hh24:mi:ss') ts, 153 val from dual union all
                       select to_date('10.09.2012 21:21:33', 'dd.mm.yyyy hh24:mi:ss') ts, 153 val from dual)
    select   ts, val
    from     sampledata
    order by ts asc;
    How should I change the select statement to ignore all data sets before the first minimum and duplicates after the maximum of a day to get such a result:
    TS     VAL
    09.09.12 06:12     23
    09.09.12 07:12     29
    09.09.12 08:12     30
    09.09.12 09:12     45
    09.09.12 10:12     60
    09.09.12 11:12     75
    09.09.12 12:21     95
    09.09.12 13:21     120
    09.09.12 14:21     142
    10.09.12 06:12     14
    10.09.12 07:12     34
    10.09.12 08:12     58
    10.09.12 09:12     70
    10.09.12 10:12     120
    10.09.12 11:12     142
    10.09.12 12:21     153
    Thank you

    Hello

    msinn wrote:
    Hello Forum,

    a value is accumulated more a day and over a period of time. The next day, the value is reset and starts to build up again:

    Thanks for posting the sample data and results. Be sure to explain how you get these results from these data. For example "for each day, I just want to show the lines after the daily low was reached. For example, on September 9, the lowest val was 23, which occurred at 6:12, so I don't want to show all lines earier to 06:12 September 9. In addition, when a val is the same as or more than the previous same day val (in order by ts), then I don't want to display the line later. For example, on 9 September, there are several consecutive lines, starting at 14:21 which all have the same val, 142. I want to only display the ealiest of this group, the line of 14:21. »

    Here's a way to do it, using analytical functions:

    WITH   got_analytics     AS
    (
         SELECT  ts, val
         ,     MIN  (val) OVER ( PARTITION BY  TRUNC (ts)
                                  ORDER BY       ts  DESC
                        )      AS min_val_after
         ,     CASE
                  WHEN  val = MIN (val) OVER (PARTITION BY  TRUNC (ts))
                  THEN  -1    -- Impossibly low val.  See note below
                  ELSE  LAG  (val) OVER ( PARTITION BY  TRUNC (ts)
                                              ORDER BY         ts
                               )
              END      AS prev_val
         FROM    sampledata
    )
    SELECT       ts
    ,       val
    FROM       got_analytics
    WHERE       val     <= min_val_after
    AND       val     >  prev_val
    ORDER BY  ts
    ;
    

    This requires that val > = 0. If you don't know a lower bound for val, and then the same basic approach still works, but it's a bit messier.

  • The libraries CC2015 and special characters.

    I'm on Windows 8.1 and I have a PSD in my library which is only an image that I've resized in Photoshop, and when he was named "16:9" without the quotes I couldn't hang out in my calendar. However, when I renamed him "16 x 9" I could. I also had a file called "Hue/Saturation 1" without the quotes, and when I renamed him "Hue - Saturation 1" I could drag it to the timeline. " Is this a known problem can anyone else confirm this?

    Colon and slash are Noo - Noo filenames under Windows.  My guess is bringing the library into a sequence also brings it down from the cloud on your local hard drive, where it would need a file name.

  • Space and special characters in a header.

    Hi all
    I have a problem with the header of a report I want to generate by ODI.
    I reproduce an old report which had the header of column, something like XXXXx YYYYY YYYYY.
    If I put exactly the same header with spaces in ODI, he doesn't; then, I found a work around putting underscores (XXXX_YYYY_YYYYY).
    It does not work to put the header between some special characters like or "because I already tried.
    Is it possible to avoid the use of underscores?

    Thank you
    Not

    Hello

    I did a few test and to do what you need to customize some KM medium...

    GOLD:

    (1) create a file with the header in a procedure (or even as a stage KM).

    You can use a simple procedure not as:

    The OS command

    the echo of MY header; COLUMN 1; COLUMN 2; > MY_TARGET_REPORT.txt

    (2) run you interface with no header generation.

    Make sense?

    Published by: Cezar Santos 22/01/2009 13:10

  • Hello. Can he the word pdf conversion to retain the original character of the special characters of the algorithm? the formulas have special mathematical symbols. Conversion them kept?

    Hello. Can he the word pdf conversion to retain the original character of the special characters of the algorithm? the formulas have special mathematical symbols. Conversion them kept?

    The equations are a problem. If the equation is text, you can be lucky if you have the fonts on your system. Most of the time I have try, the fonts in the equation are garbage. Expect to have to retype the equations and some special characters. Much also depends on the existence of the fonts on your system. Just in my experience, the equations are almost impossible to convert.

  • Language problem: ODBC changes special characters

    We are running Oracle 10 g and you have clients who need to access certain points of view using an ODBC connection.

    The Instant Client ODBC package installation goes smoothly. We have established a system DSN and the customer has a connection to the database.

    Some special characters (e.g. German "& licence;","& ouml;) "," & uuml; "and the symbol"& Oslash; ("in diameter) are however changed when seen in Access or other 3rd party programms that use this system DSN (" "& licence; ' becomes 'a'," & ouml; "becomes"o","& Oslash;"becomes"? ", etc..").

    I guess there may be only a single parameter, that we missed to set up. Can anyone help?

    TNSNAMES. ORA (name changed):

    ORACLE_DEVELOP =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP) (HOST = & lt; hostname & gt;)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = xyz)
    )
    )

    Edited by: user10620045 the 16.12.2008 02:12

    Ensure that your NLS_LANG = TERRITOIRE_LINGUISTIQUE. CHARACTERSET is compatible with that obtained on the database server.
    the value of your CHARACTER set must match exactly that of the database.

Maybe you are looking for