String of tokens in lines

Hello

I have a problem and I think I might just not be able to see the forest for the trees! In any case, I often use this technique to mark a string into lines:

With tst As (
Select 'row1' r, 'Hello,World,Test' d From Dual
)
Select Regexp_Substr(d,'[^,]+',1,level) From tst
Connect By Instr(d,',',1,level-1) > 0;

It gives me three rows:

Hello

World

Test

However, if I now have another row in the table, it breaks:

With tst As (
Select 'row1' r, 'Hello,World,Test' d From Dual
Union All
Select 'row2' r, 'Some,Other,Row' d From Dual
)
Select Regexp_Substr(d,'[^,]+',1,level) From tst
Connect By Instr(d,',',1,level-1) > 0;

What I want is:

Hello row1

Row1 world

Row1 Test

row2 some

other row2

row3 Row

However, what I actually get is:

Row1Hello
Row1World
Row1Test
row2Line
row2Other
Row1Test
row2Line
row2Some
Row1World
Row1Test
row2Line
row2Other
Row1Test
row2Line

I tried to do 'connect prior r = r' etc but then be careful against cycles. Nocycle adding does not work.

Someone help me out here?

Add and prior sys_guid is not null to circumvent the cycle warning

Tags: Database

Similar Questions

  • Add LogFilter match string for the subject line of the e-mail notification

    Hello

    On the LogFilter alerts, I add the matching string in the subject line of the e-mail logfilter alert notification. I followed KB 75058 for this requirement. But I'm getting other data also with the match string. Please find the attached screenshot. The chain is marked in yellow. I don't need data which is marke red din. Can you let me know if a setting can be done in the script that retrieves the hitstring so that only the histstring appear

    FMS: 5.6.4

    Kind regards

    Roshan.

    Additional accessories:

    Hi Roshan

    We do something similar.  We have configured a Message appropriate for each matching string user:

    Then, in the rule Condition, I created an expression UserError containing the following:

    def controls = checkObservationAlarms (#LogFilter_ErrorVerbose to 1ms #,)

    {the entry->

    If (entry.get ("Severity") == "WARNING") {}

    return 2;

    }

    If (entry.get ("Severity") == 'CRITICAL') {}

    return 3;

    }

    If (entry.get ("Severity") == "FATAL") {}

    return 4;

    }

    return 0;

    },

    {entry, severity-> {switch (severity)}

    case 2:

    Return entry.get ("User_Message");

    case 3:

    return "" + entry.get ("User_Message") + "";

    case 4:

    return "" + entry.get ("User_Message") + "";

    by default:

    Return ' ';

    }}, @foglight_rule_id);

    If (checks.size () > 0) {}

    return checks [0] [1];

    } else {}

    Return ' ';

    }

    By referencing @UserError in the subject line, I get the Message to the appropriate user.

    I also do a similar thing for the severity of error appropriate in my subject line.

    Hope this helps

    Brian

  • Split string on the new line

    G ' Day,.

    I am writing a process that takes as input a multiline string. I need to chop this string through line breaks and iterate over each of them, but I can not work how to split a string based on the line breaks and TEO reference Guide is sufficiently vague as to what special characters (if any), you can split a string on.

    This process is intended to be launched directly via TEOWebConsole at this point else I would implement it in CCP instead.

    Thoughts?

    You can use the regular expression ^. * $

    and then feed in the chain and the loop and then through it, cut the ends and go from there.

    I have a TAP of some commonly used functions that I use in many of my automation. I call the function automation tools. I downloaded the zipped here tap. Download, unzip and import.

    It has a function called multiline convert to single-line string. While that might not be exactly what you're doing, you can remove the pieces of the rupture in the line break and be ok I think.

    Here is a screenshot of what I mean:

    -shaun

  • Replace the string on a specific line

    Hi everyone thanks in advance for your time.

    I have almost finished a project, (a software to manage the booking of hotel rooms and a database of passengers).

    I made a function that writes a .txt file a cluster with some personal information string type fields, each field is separated by tabs, and each client separated by a line news.

    Example: name address phone etc.

    Robert xxxxxx yyyyyyy

    Patrick xxxxxx yyyyyyy

    Mila xxxxxx yyyyyyy

    Now I don't know how I can do to perform a search by name and to be able to change each field.

    Example:

    If I search for Patrick, I want to be able to change the address or phone number or any other field.

    I know how to search in a text file, until I reach the word, but I don't find a way to change the field and write once again the information in the same file in the same line of origin.

    Any contribution will be great! Thanks again.


  • Worksheet VI String table truncate my lines

    I'm using Labview 8.0.

    I'm animal in my VI VI "String in array to worksheet", an array of strings that are in the following format.

    09/07/2010 7:43:23.27472 95.284953

    09/07/2010 7:43:23.27572 95.284953

    09/07/2010 7:43:23.27672 95.284953

    09/07/2010 7:43:23.27772 95.284953

    :             :                     :

    The first entry is the data, the time, and then the data.

    The problem I have is that when I moved this array of strings through the "chain of array to worksheet" VI it cuts the entries and I get the following text:

    07.

    07.

    07.

    07.

    :

    The format that I fed to the VI is <%s> for string. Any help would be great. Thank you!

    < br / >
  • Table in spreadsheet string - no end of line

    In the attached VI, I expect to have a character at the end of the line at the end of each element of the array.  The indicator chain on the front panel, I get a line instead of three.  What have I done wrong?

    Thank you.

    By default, a tab is the separator for the worksheet line.  Just set it's the constant of end of line.

  • string find and delete line

    I have search and delete something like this:

    name: myvmname

    device: Reader

    Location: NomCluster

    type: windows2003

    name: myvmname2

    device: Reader

    Location: NomCluster

    type: windows2003

    ..

    ...

    etc...

    ...

    I know that I probably have something like:

    Get-Content myfile.txt | foreach-object {$_ - replace "device drive", ("")}

    So my question is:

    (1) is there a better way to remove the line "device: Reader.

    (2) after the deletion of will there and empty space between "name and location ', if so is there a way to push the high place and all that?

    (3) when I run the command I posted above, it does not change the file "myfile.txt, but statement instead of the screen has changed." How to change the file also with changes reported to the screen?

    name: myvmname2

    < - empty line - yuk!

    Location: NomCluster

    type: windows2003

    more like what I want:

    name: myvmname2

    Location: NomCluster

    type: windows2003

    The following PowerShell script will remove the "device:" lines from a file named MyFile.txt:

    Get-Content - Path myfile.txt |

    Where-Object {$_-notlike "device: *"} |

    Set-Content - Path mynewfile.txt

    Remove-Item - Path MyFile.txt

    Rename-Item - Path mynewfile.txt - NewName MyFile.txt

  • Code string to come on line 1 that doesn't have type I

    I'm working on a tutorial in class, and I got this code string:

    import flash.events.MouseEvent;

    I don't know why I'm going, but I'm not typing. I can delete and if I save my file, it is not upward. I can't understand why it happens... There is no influence on what, and the code runs correctly with him there or he spent. Any help? (I added the screenshot just in case...)

    randomcode.png

    Flash automatically adds import instructions when present you different classes in the code.  It is likely that he added importation MouseEvent as soon as you typed in MouseEvent to the event listener that you added.

    When you write code in a class file (separate .as file) you would normally include all these import declarations so that the compiler knows where to look.  When working in the control panel Flash Actions that you don't need to include them, because the class path is defined in Flash, although there are a few that should be included, such as the Tween class for example.

  • String returned when no line is found

    All,

    I have a query based on a table that returns at most only 1 row due to pk filter, but now I want to add as (select 'Generic' of the double) If no line is returned from the table the main tableEmp, then how do about it? Pls remember I want to use a proc/pkg etc I want just a query statement / select pure.

    Oracle 11g,

    Thank you all.

    with your_query as (
      select ename
      from scott.emp
      where empno=99999
    )
    select nvl(ename,'Generic') ename
    from DUAL D
      left outer join your_query on (1=1);
    
  • string delimiter of pipe lines using regular expressions

    Can Hi anyone please help write pipe 'l' values of line splitter


    Samples "something1 |" something2 | something3'


    I tried with query below

    SELECT THE LEVEL,
    TRIM ("" ' OF RTRIM (REGEXP_SUBSTR ("something1 |")) "") something2 | something3' | ' |',
    '".*?"|| [^|] *|',
    1,
    LEVEL
    ),
    '|'
    )
    ) sub_str
    OF the double
    CONNECTION OF LEVEL < = LENGTH (REGEXP_REPLACE ("something1 |")) something2 | "something3 ','". * ? » | [^|] *')) + 1
    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 'something1|something2|something3' as txt from dual)
      2  -- end of sample data
      3  select REGEXP_SUBSTR (txt, '[^|]+', 1, level)
      4  from t
      5* connect by level <= length(regexp_replace(txt,'[^|]*'))+1
    SQL> /
    
    REGEXP_SUBSTR(TXT,'[^|]+',1,LEVE
    --------------------------------
    something1
    something2
    something3
    
    SQL>
    
  • I'm used to be able to type my search string in the address line and Google sdearch results produced. After my last update of firefox, it became BING. I HATE Bing. I want Google back. How can I change this back to google or another search engine?

    (The details are in the question already)

    Thanks, Matt! Worked beautifully.

  • I'm getting invalid token on line 21 and 23.

    And I don't know which characters are not valid!

    http://podcast.l2today.com/L2-podcast.XML

    This link might give you a better idea of what is happening. Help, Roger! I know that you are there.

    https://validator.w3.org/feed/check.cgi?URL=http%3A%2f%2Fpodcast.l2today.com%2Fl 2 - podcast.xml

  • Problem with scanning chips string token

    Hi, I use the string scanning for token read in a string of tokens that contain key "*" char in front of each string and ends when the token index = - 2. It works fine if I said * 12345 * 1234 and so forth, but if there is incorrect data, say 1234 the leaderless ' * ' in front, the return value token index is always-1 and it returns the data I read thinking that there the «*» Maybe I shouldn't use the string for the symbolic function since it is probably intended just for the chips to end and not data with tokens. Is there a way to make this work, or should I use another method to search for tokens in a string?

    Thank you.

    Here try this one.  He did the same thing and exposed uses functions.

    The string functions look for something mark the end of a string.  All languages that I know to do it.  So, as I said, delete the first element.  I recommend the subarray with the index value 1 function and length thread continues.

  • String concatenation with a new line

    Hey,.

    I'm doing something that I considered quite simple but hit a few problems.  I'm looping through an array of strings and concatenting them with a new line separator and put the result to the Clipboard string so that it can then be pasted into a field. The problem is what is the sign of a new line separator?  I tried:

    « \n »

    '\r' + '\n'

    « \n »

    System.getProperty ("line.separator");

                  String txtToPaste = "";
                    String eol = System.getProperty("line.separator");
                    for (int entryIndex = 0; entryIndex < entries.length; entryIndex++) {
                        txtToPaste += entries[entryIndex];
                        // if we are not the last entry then add a new line
                        if (entryIndex < entries.length) {
                            txtToPaste += eol;
    
                        }
                    }
    

    What is the right way to build a string with newlines inside?

    Thank you.

    something like txtToPaste = entries [entryIndex] + "\n"; might solve your problem.

  • A matching logfilter string can span several consecutive lines in a log file

    Hello

    is it possible to have a matching log filtering string cover several consecutive lines in a log file?

    Unfortunately, we have some error messages in the log files that I need to match that cover several new lines.  You don't know why they did it, but his frustration for us at the end of surveillance.

    So would need to have a matching string that correspond to a portion on the first line and another on lines 1-2 below.

    My guess is that it can not be done, but thought I'd check here first.

    "mark".

    Confirmed.

    LogFilter reads and tests for matches of the mistake of a single line of the log at a time.

    Kind regards

    Brian Wheeldon

Maybe you are looking for