How to get a set of character within a string?

Hi,
I need to cut a set of character within a string. I have tried everthing but I need help.
Example.
Database Version 11.2.0.3
create table tst_string (message varchar2(600));
insert into tst_string values ('ANR0166I Inventory file expiration finished processing for node OSOGBO, filespace OSOGBO\SystemState, copygroup BACKUP and object type GROUP BASE with processing statistics: examined 43, deleted 43, retrying 0, and failed 0. (SESSION: 1506, PROCESS: 2)');
insert into  tst_string values ('ANE4175I Starting Full VM restore of VMware Virtual Machine ''mfujiwara'' target node name=''VC1_DC1'', data mover node name=''VC1_DC1_DM3''  (SESSION: 3780)');
commit;
select * from tst_string;
MESSAGE
ANR0166I Inventory file expiration finished processing for node OSOGBO, filespace OSOGBO\SystemState, copygroup BACKUP and object type GROUP BASE with processing statistics: examined 43, deleted 43, retrying 0, and failed 0. (SESSION: 1506, PROCESS: 2)
ANE4175I Starting Full VM restore of VMware Virtual Machine 'mfujiwara' target node name='VC1_DC1', data mover node name='VC1_DC1_DM3'  (SESSION: 3780)
## I want get
# From first line following values:
node OSOGBO
filespace OSOGBO\SystemState
examined 43
deleted 43
retrying 0
failed 0
# From second line
mfujiwara
VC1_DC1
VC1_DC1_DM3Any help can be useful...
Thanks in advance.

Hi Frank,
It looks like message can be seen as delimited lsit of sub-messages, where a number of different characters (perhaps ',' amd ':') may serve as delimiters. Each sub-message may or consist (entirely or in part) of something you want to display.Yes. In my first case where is "ANR0166I" I want get the characteres before "," (e.g "OSOGBO," I want get "OSOGBO") excluding "(SESSION: 1506, PROCESS: 2)"
Would a user-define PL/SQL function be okay for you?Yes.. no problem.
I'm not good with shell script, but will try show what I want using SHELL commands:
See this example:
### I create a file named "tst_string"
$ vi tst_string
ANR0166I Inventory file expiration finished processing for node OSOGBO, filespace OSOGBO\SystemState\NULL\System State\SystemState, copygroup BACKUP and object type GROUP BASE with processing statistics: examined 43, deleted 43, retrying 0, and failed 0. (SESSION: 1506, PROCESS: 2)
## So I used a function sed to get my desired values. The command bellow is poor, but My point is the result.
$ cat tst_string | sed 's/ANR0166I.*node //g' | sed 's/, filespace//g' | sed 's/, copygroup BACKUP and object type GROUP BASE with processing statistics: //g' | sed 's/. (SESSION.*//g' | sed 's/, deleted//g' | sed 's/, retrying//g' | sed 's/, and failed//g'
OSOGBO OSOGBO\SystemState\NULL\System State\SystemState 43 43 0 0The result was:
NODE     FILESPACE                              Examined     Deleted     Retrying        Failed      
OSOGBO      OSOGBO\SystemState\NULL\System State\SystemState     43           43      0           0I will go check the links wich you mentioned.
Thanks

Similar Messages

  • Get number of character within a String by number of pixels

    How can i get the number of character within a String
    by a width value...
    for example..
    i have a String = "1234567890abcdefghi.........."
    and when i give the width "10"
    i will get the String "12".
    or the number of charcter..
    or somthingggggggggggggggg
    please help..
    Shay

    i solved this...
    by doing somthing similar..
    i made a for loop on all character
    and evrey time i am get a sub string from the 0 till the loop index..
    and i am chashing the last string
    so when a sub width is greater the the requested width
    i am returning the lst cashed result
    thanks.. all..

  • How to get Document Set property values in a SharePoint library in to a CSV file using Powershell

    Hi,
    How to get Document Set property values in a SharePoint library into a CSV file using Powershell?
    Any help would be greatly appreciated.
    Thank you.
    AA.

    Hi,
    According to your description, my understanding is that you want to you want to get document set property value in a SharePoint library and then export into a CSV file using PowerShell.
    I suggest you can get the document sets properties like the PowerShell Command below:
    [system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
    $siteurl="http://sp2013sps/sites/test"
    $listname="Documents"
    $mysite=new-object microsoft.sharepoint.spsite($siteurl)
    $myweb=$mysite.openweb()
    $list=$myweb.lists[$listname]
    foreach($item in $list.items)
    if($item.contenttype.name -eq "Document Set")
    if($item.folder.itemcount -eq 0)
    write-host $item.title
    Then you can use Export-Csv PowerShell Command to export to a CSV file.
    More information:
    Powershell for document sets
    How to export data to CSV in PowerShell?
    Using the Export-Csv Cmdlet
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to get or set default fiscal year value in billing doc

    Hi All, my question is simple, how to get or set default fiscal year value (VBRK_GJAHR) in billing document.. is it possible.
    Thanks.
    Regards,
    Michael

    Hi Michel
    If you feel that the fiscal year value should come  in the billing document then you have to use a user exit USEREXIT_NUMBER_RANGE .
    As this is a related to ABAP , you should give the inputs and ABAP'ers will give the number range as per our requirement .
    Regards
    Srinath

  • How we can find the last character in a string(Urgent Plz!)

    Gurus!
    How we can find the last character in a string.
    e.g i have a string say "Str" with value "10-01".
    Now i want to find the last character in "Str" i.e "ONE=1".
    i am using Oracle developer 6i with Oracle 8i(1.7).
    Plz help!
    Many thanks!

    Use the substr() and length() functions -
    x := '10-01';
    y := substr(x, length(x));

  • How to get the set pf-status and call Transaction work together in SA

    hi,
    I am using Set pf-status to display the details screen and the same time using call transaction va03 leave screen 0 to display the corresponing sales order.
    The issue is both of them are not workin together properly.
    it could be helpfull if you give some code which deals the issue in detail...
    can you please give details how to get the previous screen once the new screen is obtained thru set pf-status
    thanks and regards
    Edited by: san dep on Jul 10, 2008 6:25 PM

    Hi,
    Try this code ---
    SET PF-STATUS 'STATUS_NAME' OF PROGRAM 'ZPROGRAM_NAME'.
    Regards
    Pinaki

  • How to get a handle of tcUtilityFactory within Java Task

    Hi
    I am trying to user op interface within a java task and want to avoid the GUI based coding in adapter factory
    I am having doubt about how to get a handle of tcUtilityFactory
    the standalone example of getting the handle works fine within a Java task
    // ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    // final Hashtable env = config.getAllSettings();
    // ioUtilityFactory = new tcUtilityFactory(env, "xelsysadm", "welcome1");
    but I want the handle to be provided by adapter runtime env
    there is a function call within generated adapter code
    APITaskLocal.getUtilityFactory(getDataBase());
    but I get null pointer if I try to use it within custom code
    has anyone played around with APITaskLocal.getUtilityFactory

    Hi,
    Use this code.
    public void init(tcDataProvider dataProvider) {
    try {
         usrOps = (tcUserOperationsIntf)tcUtilityFactory.getUtility(dataProvider, "Thor.API.Operations.tcUserOperationsIntf");
    } catch(Exception e) {
    log.error("Unable to initialize: "+e);
    You can pass dataProvider in adapter mapping . Map it to Adapter reference->Database reference.
    Hope this will help.
    Regards
    Nitesh

  • How to get and set custom tag attributes

    How do i get and set custom tag attributes from a jsp page?

    Not sure if this is what your looking for, but....
    example...
    < taglibprefix:testtag attribute1="x" attribute2="y">
    ...of course, the attributes have to be defined in your taglib (.tld) file

  • How to call a set method from within a constructor

    Hello,
    I want to be able to call a set method from within a Scanner, to be used as the argument to pass to the Scanner (from a source file). Here's what i tried:
    private void openFiles()
            input = new Scanner( setSource );              
        and here is the set method:
    public String setSource( String in )
            source = in;
            return source;
        }obviously there will be more code in this method but i'm trying to tackle one problem at a time. Thanks in advance..

    The "String in" declaration says: "Nobody may ever invoke setSource() without specifying a certain String. The content of the String is known at run-time only."
    In no place in your code you say the compiler: "I want the 'in' variable (actually, parameter) of method setSource() to contain the first arg which is passed to the application".
    This is exactly the same mechanism allowing you to write "new Scanner" with something inside the two parentheses.

  • SQL query - how to get parameters into a function within a SELECT statement

    Hi,
    I have SQL query roughly as follows
    SELECT A, B, C, MAX(CASE...) AS "D_NAME", FunctionX(B, C, "D_NAME")
    FROM...
    WHERE...
    How to get alias "D_NAME" as a valid parameter into FunctionX?

    Hi,
    user8819407 wrote:
    Hi,
    I have SQL query roughly as follows
    SELECT A, B, C, MAX(CASE...) AS "D_NAME", FunctionX(B, C, "D_NAME")
    FROM...
    WHERE...
    How to get alias "D_NAME" as a valid parameter into FunctionX?Either
    (1) repeat the calculation or
    (2) compute it in a sub-query
    Here's an example of (2)
    WITH  got_d_name  AS
        SELECT A, B, C, MAX(CASE...) AS "D_NAME"
        FROM...
        WHERE...
    SELECT  A, B, C, D_NAME, FunctionX (B, C, D_NAME)
    FROM    got_d_name
    ;A column alias (like d_name) can be referenced in the ORDER BY clause of the query where it was defined, but that's the only place in that query where it can be referenced.

  • How to get result set

    Hi all,
    Please tell me how to get the below required out put.
    this is my table and data
    with t as (select 11 plcy,1 nm from dual union all
    select 11 plcy,2 nm from dual union all
    select 11 plcy,3 nm from dual union all
    select 11 plcy,5 nm from dual union all
    select 22 plcy,1 nm from dual union all
    select 22 plcy,2 nm from dual union all
    select 22 plcy,3 nm from dual union all
    select 33 plcy,1 nm from dual union all
    select 44 plcy,2 nm from dual union all
    select 55 plcy,4 nm from dual union all
    select 66 plcy,3 nm from dual )
    select * from t
    this my required output.
    from above query required output is below
    plcy      nm
    11      5
    33      1
    44      2
    55      4
    66      3
    if pass nm = 5 then 11
    if i pass nm= 1 then 33
    if i pass nm=2 then 44
    if pass nm = 4 then 55
    if i pass nm =3 thne 66
    it means it has only one value from plcy
    11 5
    33 1
    44 2
    55 4
    66 3
    thanks,

    Something like this:
    SQL > with t as (select 11 plcy,1 nm from dual union all
      2             select 11 plcy,2 nm from dual union all
      3             select 11 plcy,3 nm from dual union all
      4             select 11 plcy,5 nm from dual union all
      5             select 22 plcy,1 nm from dual union all
      6             select 22 plcy,2 nm from dual union all
      7             select 22 plcy,3 nm from dual union all
      8             select 33 plcy,1 nm from dual union all
      9             select 44 plcy,2 nm from dual union all
    10             select 55 plcy,4 nm from dual union all
    11             select 66 plcy,3 nm from dual
    12  )
    13  SELECT     MAX(plcy) plcy
    14  ,  NM
    15  FROM       t
    16  GROUP BY NM
    17  ORDER BY PLCY
    18  /
          PLCY         NM
            11          5
            33          1
            44          2
            55          4
            66          3

  • Insert set of character in a string

    hi guys,
    I have created a string of length 19, i need to insert set of character and compare them if its right format or not.That is for barcode i need. i WANT MY PROGRAM TO GENERATE THIS FORMAT BARCODE.
    eg : INV40602007RE000155

    Hi
    SEARCH
    Variants:
    1. SEARCH f    FOR g.
    2. SEARCH itab FOR g.
    Note
    Like all string processsing statements, you can only use character-type operands here.
    If the type of an operand is not STRING, the operand is treated like a type C field, regardless of its actual type, even though no actual conversion takes place.
    See Only character fields allowed in string processing.
    Variant 1
    SEARCH f FOR g.
    Additions:
    1. ... ABBREVIATED
    2. ... STARTING AT n1
    3. ... ENDING   AT n2
    4. ... AND MARK
    Effect
    Searches the contents of f for the string in the field g. This string can have any of the following formats:
    'str'
    a character string (trailing spaces are ignored)
    '.str.'
    any character string between the periods
    '*str'
    a word ending with "str", including "str"
    'str*'
    a word beginning with "str", including "str"
    You can use any non-alphanumeric character as a separator, that is, spaces, punctuation marks and non-printable characters.
    Note
    The search patterns 'str' and '.str.' are identical apart from a few exceptions. You must use '.str.' when the pattern str contains spaces (at the end), the '.' character (at the beginning and end), or the '*' character (at the end). You should also use '.str.' when the contents of the search string str is a variable, since you cannot predict when you write the statement what the contents of the string will be.
    The system does not distinguish between upper and lower case characters.
    The return code is set as follows:
    SY-SUBRC = 0:
    The search string g was found in the field f. SY-FDPOS contains the offset of the found string or the found word within the field.
    SY-SUBRC = 4:
    The search string g was not found in the field f.
    Addition 1
    ... ABBREVIATED
    Effect
    Searches the field f for a word containing the character string specified in the field. Here, the characters specified in g may be separated by other characters in the word. If the string g occurs in a word, the return code in system field SY-SUBRC is set to 0. The first letter of the search string g and of the word must match.
    Example
    DATA F(50).
    MOVE 'Alaska Texas California' TO F.
    SEARCH F FOR 'Clfrn' ABBREVIATED.
    Here, SY-SUBRC is set to 0, since not only does the string 'Clfrn' occur (separated by other characters) in 'California', but 'Clfrn' and 'California' begin with the same letter.
    Addition 2
    ... STARTING AT n1
    Effect
    Searches the field f starting from the position n1. Here, n1 can also be a field containing the corresponding value. The first character in the field f is in position 1.
    When you use the addition STARTING AT, the position specified for the found pattern in SY-FDPOS does not refer to the start of the field, but to the position n1.
    Addition 3
    ... ENDING AT n2
    Effect
    Searches the field f up to the position n2.
    Addition 4
    ... AND MARK
    Effect
    If the search string g is found, all the characters of the search string and all the characters occurring in between (in the case of SEARCH ABBREVIATED) are converted to upper case in the field f.
    Example
    DATA F(20) VALUE 'Peter Paul Mary'.
    SEARCH F FOR '*UL' AND MARK.
    SY-SUBRC is now set to 0, since the search string was found in 'Paul'. SY-FDPOS has the value 6, since the character string found starts at the offset 6. Also, the search string is marked, so that the new contents of f are as follows:
    'Peter PAUL Mary'
    Variant 2
    SEARCH itab FOR g.
    Additions:
    1. ... ABBREVIATED
    2. ... STARTING AT line1
    3. ... ENDING   AT line2
    4. ... AND MARK
    Effect
    Searches the internal table itab for the string in field g. The string can have the same format as in variant 1. The value of SY-SUBRC is set to 0, if the search string is found in the table. The system field SY-TABIX then contains the number of the table line where the string was found. Meanwhile, SY-FDPOS specifies the offset of the found string within the table line.
    Note
    The statement does not search the header line of an internal table itab.
    Addition 1
    ... ABBREVIATED
    Effect
    As with SEARCH ABBREVIATED, searches the internal table itab for a word that contains the character string specified in the field g. Here, the characters specified in g can be separated by other characters in the word. The return code value of the system field SY-SUBRC is set to 0, if the string g occurs in a word. The first letter of the search string g and of the word must match.
    Addition 2
    ... STARTING AT line1
    Effect
    Searches the internal table itab starting from line line1 to the end. line1 can be a field that contains the corresponding values.
    Addition 3
    ... ENDING AT line2
    Effect
    Searches the internal table itab up to the line line2.
    Addition 4
    ... AND MARK
    Effect
    If the search string g is found, all the characters of that search string and all the characters occurring in between (in the case of SEARCH ABBREVIATED) are converted to upper case in the internal table itab.
    Example
    Let T be an internal table which is empty:
    TYPES: BEGIN OF T_TYPE,
            LINE(80),
          END OF T_TYPE.
    DATA: T TYPE STANDARD TABLE OF T_TYPE WITH
                 NON-UNIQUE DEFAULT KEY,
          WA_T TYPE T_TYPE.
    MOVE 'Alaska Texas       ' TO WA_T.
    APPEND WA_T TO T.
    MOVE 'California Arizona ' TO WA_T.
    APPEND WA_T TO T.
    SEARCH T FOR '*ONA' AND MARK.
    SY-SUBRC is now set to 0 because the search string was found in 'Arizona'. SY-TABIX contains the value 2 because 'Arizona' appears in the second line of the table T. SY-FDPOS is set to 11 because the found character string begins at the offset 11. Also, the search string was marked in the second line in such a way that the contents of that line now look as follows:
    'California ARIZONA'
    Note
    Performance:
    Searching generically for a string in an internal table is much more runtime-intensive (approx. 5000 msn (standardized microseconds)) than searching for 'str' (approx. 20 msn). This was measured using a table with 200 entries and 10 fields.
    If you perform a search in a field which is 50 bytes long for 'str' or 'str', the runtime consumption is approx. 300 msn, whereas searching for 'str' takes about 15 msn.
    Regards,
    Raghav

  • How to get the length in bytes of a string

    My string has both latin (1 byte) and chinese (2 bytes).
    My program is in unicode system.
    How to measure the length in bytes of the string?
    the xlen function does not work.

    Hello,
    parameters : p_str type string.
    data : len type i.
    len = strlen( p_str ).
    write : / len.
    With Regards,
    BVS
    Hi BSV, your code return the number of characters not bytes.
    Remember chinese character in US are encoded with 2 bytes.
    And my string contain both latin and chinese characters.
    thanks

  • How to find out the repeated character in a string value?

    Dear People,
    I want to trace out the names where a character occured more than once.for ex, i need o/p as
    ENAME
    ALLEN
    TURNER
    ADAMS
    In which all the above name consists of repeated characters.
    I use Oracle 10g and i tried using REGEXP say for ex,
    SELECT ENAME FROM EMP WHERE REGEXP_LIKE(ENAME,'L{2}');
    ENAME
    ALLEN
    MILLERbut this works only for single character.how to specify condition for any character?.pls suggest me.
    With Regards
    VIDS

    Here is one way you can use from version 10 upwards:
    SQL> with emp as
      2  ( select 7369 empno, 'SMITH' ename, 'CLERK' job, 7902 mgr, date '1980-12-17' hiredate, 800 sal, NULL comm, 20 deptno from dual union all
      3    select 7499, 'ALLEN', 'SALESMAN', 7698, date '1981-02-20', 1600, 300, 30 from dual union all
      4    select 7521, 'WARD', 'SALESMAN', 7698, date '1981-02-22', 1250, 500, 30 from dual union all
      5    select 7566, 'JONES', 'MANAGER', 7839, date '1981-04-02', 2975, NULL, 20 from dual union all
      6    select 7654, 'MARTIN', 'SALESMAN', 7698, date '1981-09-28', 1250, 1400, 30 from dual union all
      7    select 7698, 'BLAKE', 'MANAGER', 7839, date '1981-05-01', 2850, NULL, 30 from dual union all
      8    select 7782, 'CLARK', 'MANAGER', 7839, date '1981-06-09', 2450, NULL, 10 from dual union all
      9    select 7788, 'SCOTT', 'ANALYST', 7566, date '1982-12-09', 3000, NULL, 20 from dual union all
    10    select 7839, 'KING', 'PRESIDENT', NULL, date '1981-11-17', 5000, NULL, 10 from dual union all
    11    select 7844, 'TURNER', 'SALESMAN', 7698, date '1981-09-08', 1500, 0, 30 from dual union all
    12    select 7876, 'ADAMS', 'CLERK', 7788, date '1983-01-12', 1100, NULL, 20 from dual union all
    13    select 7900, 'JAMES', 'CLERK', 7698, date '1981-12-03', 950, NULL, 30 from dual union all
    14    select 7902, 'FORD', 'ANALYST', 7566, date '1981-12-03', 3000, NULL, 20 from dual union all
    15    select 7934, 'MILLER', 'CLERK', 7782, date '1982-01-23', 1300, NULL, 10 from dual
    16  )
    17  select ename
    18       , e
    19       , count(*)
    20    from ( select ename
    21                , e
    22             from emp
    23            model
    24                  return updated rows
    25                  partition by (ename)
    26                  dimension by (0 i)
    27                  measures (ename e)
    28                  ( e[for i from 1 to length(e[0]) increment 1] = substr(e[0],cv(i),1)
    29                  )
    30         )
    31   group by ename
    32       , e
    33  having count(*) > 1
    34  /
    ENAME  E        COUNT(*)
    SCOTT  T               2
    MILLER L               2
    ADAMS  A               2
    ALLEN  L               2
    TURNER R               2
    5 rows selected.Regards,
    Rob.

  • How to get IDL file name from CORBA IOR string

    hi, is it possible to get IDL file name from the IOR string? how?
    regards

    Hi,
    I don't think so.
    And if it was possible, which interface should be returned if
    the referenced object implements more than one?
    Regards.
    Karl

Maybe you are looking for

  • Using access keys in inactive frames

    We are trying to make an existing website DDA compliant and want to use access keys to assist the keyboard-only user to navigate without a mouse. The site uses frames; we cannot change that as some 6000 pages are involved. We have implmented access k

  • HT3529 why is the phone number for imessage grayed out

    When I sign in with my apple ID and then click next, it grays out the phone number and i'm unable to use it. I don't want to use my email but it won't let me have access to my phone number. Please Help! Thanks.

  • Menu Bar - Horizontal (make a different shape)

    How can I make the menu bar a different shape (ex:   like a wave or arch)?

  • [Urgent] KMODE Exception

    Hi All, I have this serious problem launching java applications on one of the machines at my office, the jdk1.3.1 works fine but when I use j2sdk1.4.1_05 or higher I get BSOD (KMODE_EXCEPTION) and system crashes.Can anyone help me on this? ** Not eve

  • Unable to place video calls using CUPC or the IP hardphones.

    Hi, We have installed CUVA 2.1.1 software and the VT-II camera installed perfectly fine.CUCM version 6.0 and Presence 6.0.1 Also get the camera Icon on the IP hard phones as well.But unable to place video calls video calls both with CUPC clients and