Replacing multiple strings for many occurance of single string   in OBIEE a

Hi,
I have a requirement like i need to replace a Particular string('_') that occur three times in a string.I need to replace different strings for each occurance of ('_').
My requirement is like this,
My string is 'A_B_C_D' and I need to replace first'_' as 'E=' second '_' as 'F=' third '_' as 'G='.
and the final string should be I=A E=B F=C G=D...
Can any one help me in the logic or else help me how to use the existing functions in answers.

Hi,
We have Replace function in Answers which would replace all occurunces of a particular character with another. To achieve your requirement, you will need to split your string and apply replace function on each part and finally concatenate again.
For e.g. your string is 'A_B_C_D'
You need to split into, below
A_
B_
C_
D
Apply Replace function to first three parts and then finally concatenate.
Replace('A_','_','E=') || Replace('B_','_','F=') || Replace('C_','_','G=') || 'D'
To split the string into parts you may have to use substring and locate functions.
Refer the below thread too.
Re: extract a part of a string in a full  string
Thanks

Similar Messages

  • How to process multiple rows of data into a single string

    Hello,
    I am trying to process multiple rows of text from an Oracle database into one field to display on a report as continuous text. Below is sample data. The text field is 55 characters wide so anything longer is broken into multiple rows. I need to recombine it for display.
    line          text
    1             IN THE N.E. QUADRANT OF THE INTERSECTION OF THE FAIRFAX
    2              COUNTY PARKWAY AND THE DULLES AIRPORT ACCESS AND THE T
    3             OLL ROAD AND SOUTH OF SUNSET HILLS ROAD
    I tried creating a formula field but it did not work, below is the code in Visual Basic syntax. I also tried using the Maximum() and UBound() functions without luck. I don't quite understand how to make the UBound() work; it threw a lot of errors.
    Dim i As Number
    Dim strLocDesc As String
    For i = 1 To count({LDS_AR_RL_COMM.ART_LINE_NUM})
        strLocDesc = strLocDesc & {LDS_AR_RL_COMM.ART_COMM_RMK}(i)
    Next i
    formula = strLocDesc
    Any ideas on how to solve this?

    Hello Allison,
    You can try this:
    Create a formula called @StoreText, place it in the details and have the following code in it:
    WhilePrintingRecords;
    Global StringVar Text1;
    Global StringVar TextRest;
    if {field.line} = 1 then
    Text1:= {field.text} else
    if {field.line} >= 2 then
    TextRest := TextRest+" "+{field.text};
    In the Group Footer you can have a formula called @GetStoreText with the following code in it:
    WhilePrintingRecords;
    Global StringVar Text1;
    Global StringVar TextRest;
    Text1+varTextRest;
    See how that works out for you.
    Regards,
    Zack

  • Database storage of multiple languages for name of a single entity

    Surely I'm not the first person to have this problem, but I can't find many resources on how to solve this. Just some background on what I'm working with, I'm running a web application using the Struts framework with jdk 1.4 on a Weblogic 8.1 server connected to an Oracle 9i database, I'm using DAO for my persistence layer, and I'm not opposed to using any 3rd party software to assist in this task.
    For example, say I have a database of DVDs, My application will retrieve the list of DVDs from the database to display to the user. Depending on the user's Locale I want to display the title of the DVD in that language.
    This is a simple example, but the real-world application is much more complicated. The application is highly configurable meaning that through a configuration application, my internal users can add DVDs at any time, edit the title of the DVD, or add a new language that they want the title to display in, etc. When a customer logs in to the application front-end they will be able to change the language they want the application to display in at any time, and the application will need to reflect that change. The display of constant text like field labels and page text is easy using Struts but its this configurable dynamic text thats a bit more difficult.
    Its obvious to me that I will need to store the multiple languages in the database in some way, I'm thinking of either storage in some xml format, or a new table hanging off the "dvd" table with languages for each dvd. Either of these options would work for my purposes, but I don't want to go reinvent the wheel when this same problem has arleady been solved. If someone could point me in the right direction I would appreciate it

    One common way to handle this is to modify your key for the dvd title to include a locale identifier:
    key dvdtitle
    becomes
    key locale dvdtitle
    Now your db can hold multiple translations of the same dvd title.
    Regards,
    John O'Conner
    Its obvious to me that I will need to store the
    multiple languages in the database in some way, I'm
    thinking of either storage in some xml format, or a
    new table hanging off the "dvd" table with languages
    for each dvd. Either of these options would work for
    my purposes, but I don't want to go reinvent the
    wheel when this same problem has arleady been solved.
    If someone could point me in the right direction I
    I would appreciate it

  • Firefox opens multiple tabs for many web pages.

    As many as 30 tabs open and try to load simultaneously. It doesn't do it for every site but enough to be very annoying. It just started doing this very recently.

    What is on those other tabs / windows? Sites that you know, or ads?
    You may have ad / mal-ware. Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    '''[https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/ Adblock Plus]''' {web link}
    Blocks annoying video ads on YouTube, Facebook ads, banners
    and much more. Adblock Plus blocks all annoying ads, and
    supports websites by not blocking unobtrusive ads by default (configurable).

  • Utility VI for searching for the occurance of a string in all files in a directory

    Is anyone aware of a utility VI that can search for a string(s) in all
    file types such as doc, xls, ppt etc in a specified directory?

    Greetings,
    I'm having an issue (using 8.5) with a directory read in. I've attached my elementary VI. Basically I want to read in mutliple files (they will be the same array size), and analyze each file. I am confident I will be able to analyze the data as necessary, I'm just having a problem parsing the data. Verbally I know exactly what I need to do just doesn't seem to be working in labview. Reading in the directory isn't the hard part, but breaking up the 2D data into the number of files I have apparently is for me. 
    1. Read in (user defined) directory
    2. List the file names | # of files in the directory
    3. Perform MAX value and % analysis of data on AMP array 
    Any help would be greatly appreciated. Even if it's just verbally pointing me in the right direction. I've attached the VI and 3 example data files I read in.
    Thanks in advance...I really feel like I should know this one, but I usually deal in individual files, this is my first directory read.
    Best Regards,
    Chazzzmd 
    Attachments:
    labview text upload.zip ‏33 KB

  • Replacing multiple spaces with another character

    i need to replace multiple spaces with another char in a string
    my code is
    Dim text as String="a bit much             a little much" Dim arr As String() = text.Split({" "c}, StringSplitOptions.RemoveEmptyEntries)Dim newtext As String = String.Join(" ", arr)            MsgBox(newtext)           
     it returns to "a bit much  a little much "
    But i want to replace only long spaces with "="  as  "a bit much =a little much"
    How can i do that?

    This version uses two spaces to split the string and then trims any additional single spaces. It returns "a bit much = a little much".
    Dim text As String = "a bit much a little much "
    Dim parts() As String = text.Split({" "}, StringSplitOptions.RemoveEmptyEntries)
    Dim newText As String
    If parts.Length = 2 Then
    newText = parts(0).Trim & " = " & parts(1).Trim
    End If

  • How to global replace multiple objects using csm

    Hi All
    I’m new to this forum.
    We use csm 4.6 to manage about 400 cisco firewalls. After a large migration project there are a lot of objects with different names but with the same content. I know you can do a find and replace on a single object on a single firewall policy.
    But is it also possible to replace multiple object for 1 on multiple firewall policy
    Example.
    We have 40 groups named net-1, net-2 , net-3, …. net-40 the content of the groups are the same but their used in different firewall policies. I would like to replace them all in one go on all the firewall which has one of those groups to the new group net-all.
    I’m also looking in a way to delete all non used object in the csm database (hosts, groups, network, services) Is this possible?
    Kind Regards
    Eduard

    Jacob,
    I decided to take one more stab at the logo before uploading it, and I finally figured it out.
    I selected one white shape and one colored shape. In the pathfinder panel, I clicked on the second pathfinder icon -- TRIM. That "cut out" the part of the colored shape that I needed cut out, and it grouped the two items (white and colored shapes).
    I ungrouped the items, then selected the white shape again and the other colored shape. Did this for each shape I needed cut out and now Bob's my uncle.
    Not sure why this didn't work for me before -- I was either selecting the wrong pathfinder icon, or failing to ungroup the shapes after trimming them (before re-selecting the same white shape).
    I've written down the procedure so I can remember how to do it next time!
    Thanks,
    Marlene

  • Java.util.Formatter format string for week of year?

    What is strange in the Formatter API, regarding dates, is that there is no format string to display week of year. To display day of year e.g. you can use:
    String.format(�%tj�),Calendar.getInstance())but what is the string for week of year?
    String.format(�%tw�),Calendar.getInstance())doesn�t work.
    Any ideas, or did I overlooked the API?

    I �m using
    String.format(�%tx�),Calendar.getInstance())everywhere in my code where x is any of the other (e.g. j, d etc.). Why use different way for this? How come Sun did�t add e.g. a w in the API to display the week of year as it does for day of year?

  • Resource string for panel collection bug?

    Hi all,
    Resource string af_panelCollection.LABEL_STATUSBARITEM_SELECTED_ALL for panel collection doesn't work.
    I believe this one is misspelled because all other resource strings that I use work fine.
    Does anyone know real resource string for this?

    Hi,
    this string seems to be missing in PanelCollectionRenderer.class. I'll file a bug
    Frank

  • How to replace multiple occurences of space in a string to a single space?

    How to replace multiple occurences of space in a string to a single space?

    Hi,
    try this code.
    data : string1(50) type c,
              flag(1) type c,
              dummy(50) type c,
              i type i,
              len type i.
    string1 = 'HI  READ    THIS'.
    len = strlen( string1 ).
    do len times.
    if string1+i(1) = ' '.
    flag = 'X'.
    else.
    if flag = 'X'.
    concatenate dummy string1+i(1) into dummy separated by space.
    clear flag.
    else.
    concatenate dummy string1+i(1) into dummy.
    endif.
    endif.
    i = i + 1.
    enddo.
    write : / string1.
    write : / dummy.

  • Replace multiple whitespaces in a string with single one

    Hi,
    I'm using Oracle 9.2.0 and I have a query on string manipulation.
    Can I replace multiple whitespaces within a string with single one. I tried with regexp_replace function but it is not supporting Oracle 9i.
    Can someone help me out?
    Regards,
    Pramod

    Just playing around:
    WITH
         Strings
    AS
          SELECT 'Can  I   replace      multiple  whitespaces   within    a     string    with single one' Text FROM Dual
    SELECT
         REPLACE
          REPLACE
           XMLAGG
            XMLElement
             "A",
             SubStr(Text, Level, 1)
           '</A>'
          '<A>'
         ) Text
    FROM
         Strings
    WHERE
         NOT
              Level > 1
          AND     SubStr(Text, Level, 1)          = ' '
          AND     SubStr(Text, Level - 1, 1)     = ' '
    CONNECT BY
         Level <= LENGTH(Text);

  • Replacing a single occurance in a string

    if i do string.replaceAll(old,new) then it replaces every occurance in the string
    how can i only replace the first found occurance in the string or even better specify where in the string i want to start looking
    so if i have
    hello hello hello hello
    i can say
    string.replace(5,"hello", "yellow")
    and it will give me
    hello yellow hello hello

    ive come up with this
    SNIP
    it seems to be doing the trick (so far)Good one! I guess the same is actually done with StringBuffer.replace()
    jTPdisplay.setText(new StringBuffer(f).replace(pos, pos+f.length(), r).toString());It should be something like this. :)

  • Replace multiple space characters with a single space

    Hi,
    Oracle 11g R2.
    Looking for a way to replace multiple space characters in a row with a single space. For example, the text "abc abc" should look like "abc abc". I tried toying with replace, but it only works for the case of 2 spaces. Need a solution for the cases where there could be 2 or more spaces.
    select replace(column1, chr(32)||chr(32), chr(32)) from tablea

    Hi,
    If you had to do this without regular expressions, you could use:
    SELECT  REPLACE ( REPLACE ( REPLACE (str, ' ', '~ ')
                     , ' ~'
              , '~ '
              )     AS new_str
    FROM    table_x;assuming there is some sub-string (I used '~' above) that never occurs right next to a space.
    However, unless you're uisng Oracle 9 (or earlier, which you're not doing) you don't have to do this without regular expressions. As you can see, the way Solomon showed is much simpler.

  • Replacing multiple spaces with a single space

    Hi friends,
    I have a string. It can have zero/one/multiple spaces. I want to make the multiple spaces to single space.
    Here are the cases:
    1. ' a b c d efg h' should be changed to 'a b c d e f g h'
    2. ' a b c d e f g h ' should be changed to 'a b c d e f g h'
    3. 'a b c d e f g h' should not be changed
    4. 'abcdefgh' should not be changed
    Both REPLACE and TRANSLATE do not help. I don't want to go for LOOP logic. Please help me to get it in SQL query.
    Thanks in advance!

    Hi,
    964559 wrote:
    Hi friends,
    I have a string. It can have zero/one/multiple spaces. I want to make the multiple spaces to single space.
    Here are the cases:
    1. ' a b c d efg h' should be changed to 'a b c d e f g h'One solution is to post your string on this site, and then copy it back again. (See below for a more serious solution .)
    This site is doing exactly what you want the function to do: it replaces multiple consecutive spaces with a single space. As a result, it's hard to see what you mean.
    To preserve spacing on this site, type these 6 characters
    \(small letters only, inside curly brackets) before and after each section where you want spacing preserved.
    2. ' a b c d e f g h ' should be changed to 'a b c d e f g h'
    3. 'a b c d e f g h' should not be changed
    4. 'abcdefgh' should not be changed
    Both REPLACE and TRANSLATE do not help. I don't want to go for LOOP logic. Please help me to get it in SQL query.
    Thanks in advance!Regular expressions make this easy:SELECT TRIM ( REGEXP_REPLACE ( str
    , ' +'
    ) AS compressed_str
    FROM table_x;
    You can use nested REPLACE calls to get the same results, but it's messy.
    Edited by: Frank Kulash on Feb 5, 2013 10:18 AM
    Added TRIM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to show multiple messages for a single exception

    hi
    Please consider this example application created using JDeveloper 11.1.1.3.0
    at http://www.consideringred.com/files/oracle/2010/MultipleMessagesExceptionApp-v0.01.zip
    It has a class extending DCErrorHandlerImpl configured as ErrorHandlerClass in DataBindings.cpx .
    Running the page and entering a value starting with "err" will result in an exception being thrown and multiple messages shown.
    See the screencast at http://screencast.com/t/zOmEOzP4jmQ
    To get multiple messages for a single exception the MyDCErrorHandler class is implemented like
    public class MyDCErrorHandler
      extends DCErrorHandlerImpl
      public MyDCErrorHandler()
        super(true);
      @Override
      public void reportException(DCBindingContainer pDCBindingContainer,
        Exception pException)
        if (pException instanceof JboException)
          Throwable vCause = pException.getCause();
          if (vCause instanceof MyMultiMessageException)
            reportMyMultiMessageException(pDCBindingContainer,
              (MyMultiMessageException)vCause);
            return;
        super.reportException(pDCBindingContainer, pException);
      public void reportMyMultiMessageException(DCBindingContainer pDCBindingContainer,
        MyMultiMessageException pException)
        String vMessage = pException.getMessage();
        reportException(pDCBindingContainer, new Exception(vMessage));
        List<String> vMessages = pException.getMessages();
        for (String vOneMessage : vMessages)
          reportException(pDCBindingContainer, new Exception(vOneMessage));
    }I wonder if calling reportException() multiple times is really the way to go here?
    question:
    - (q1) What would be the preferred use of the DCErrorHandlerImpl API to show multiple messages for a single exception?
    many thanks
    Jan Vervecken

    fyi
    Looks like using MultipleMessagesExceptionApp-v0.01.zip in JDeveloper 11.1.1.2.0 (11.1.1.2.36.55.36) results in a different behaviour compared to when used in JDeveloper 11.1.1.3.0 (11.1.1.3.37.56.60)
    see http://www.consideringred.com/files/oracle/img/2010/MultipleMessages-111130versus111120.png
    When using JDeveloper 11.1.1.2.0 each exception seems to result in two messages where there is only one message (as intended/expected) per exception when using JDeveloper 11.1.1.3.0 .
    (Could be somehow related to the question in forum thread "multiple callbacks to DCErrorHandlerImpl".)
    But, question (q1) remains and is still about JDeveloper 11.1.1.3.0 .
    regards
    Jan

Maybe you are looking for

  • Problem in Creating Check boxes as a column in a table using MVC

    I am trying to display a table format using the Model view controlers, with 1st column as a checkbox. if the user chooses some check boxes and submit the screen then i need to update the information in a custome table. I am having a problem in creati

  • Aperture Slow vs. iPhoto...

    Hello, I recently purchased Aperture 3.0.3 after a brief trial using 1000 photos. Once I loaded over 80,000 photos between two libraries, I find the program too sluggish to even navigate and be of any valid use (yes, I have allowed the software to co

  • ANSWER: HOW TO DETECT Java Plugin from JavaScript

    I created a new topic because the questions about how to detect Java Plugin in browsers are scattered thoughout this forum. Basically you need to employ two approaches for IE and NS. In IE you need to try to instantiate a small applet (not your produ

  • Direct billing option for an app - Droid2

    I was trying to purchase an app today -- one of the options was 'direct billing' through my provider.  I do not want to send credit card information over my phone, so I was hoping this would allow me to purchase the app and have it on my monthly Veri

  • Moving Service Manager Database From SQL 2008 R2 SP2 to SQL 2012 SP1

    Hi Guys, Just looking for some clarification about moving our Service Manager 2012 R2 database to a new SQL Server. Our Service Manager database is currently on a remote SQL server, shared with other databases, running SQL 2008 R2 SP2. It was origina