Replace a part of a string beginning with $

I have a Varchar2 column containing some text description and some words beginning with $.... For example :
Hello, I have installed an Oracle database called $name. It runs under $platform environement.
Il would like to replace all words beginning with $... using another string.
Something like : select replace(textcolumn,'$%','data') from table;
Could you give me some advice about how to do this ?
Thanks...
Lionel

select replace(replace(txt, '$name', 'FRED'), '$platform', 'MS DOS 6') from
(select 'Hello, I have installed an Oracle database called $name. It runs under $platform environement.' as txt from dual) x

Similar Messages

  • Replacing a part of a String with a new String

    Hi everybody,
    is there a option or a method to replace a part of a String with a String???
    I only found the method "replace", but with this method I only can replace a char of the String. I don't need to replace only a char of a String, I have to replace a part of a String.
    e.g.:
    String str = "Hello you nice world!";
    str.replace("nice","wonderfull");   // this won't work, because I can't replace a String with the method "replace"
                                        // with this method I'm only able to replace charsDoes anyone know some method like I need???
    Thanks for your time on answering my question!!
    king regards
    IceCube-D

    do check java 1.4 api, I think there is a method in it, however for jdk1.3 you can use
    private static String replace(String str, String word,String word2) {
         if(str==null || word==null || word2 == null ||
               word.equals("") || word2.equals("") || str.equals("")) {
              return str;
         StringBuffer buff = new StringBuffer(str);
         int lastPosition = 0;
         while(lastPosition>-1) {
              int startIndex = str.indexOf(word,lastPosition);
              if(startIndex==-1) {
                   break;
              int len = word.length();
              buff.delete(startIndex,startIndex+len);
              char[] charArray = word2.toCharArray();
              buff.insert(startIndex,charArray);
              str = buff.toString();
              int len2 = startIndex+word2.length();
              lastPosition = str.indexOf(word,len2);
         return buff.toString();

  • Replace part of a string

    I want to replace a part of a string value with another in table column(VARCHAR). For example \\server01\data\doc\123.eps with \\server02\data\doc\123.eps . How to replace the server01 part with server02?

    Use REPLACE.
    Cheers, APC
    SQL> select replace('\\server01\data\doc\123.eps', 'server01', 'server02')
      2  from dual
      3  /
    REPLACE('\\SERVER01\DATA\DO
    \\server02\data\doc\123.eps
    SQL>

  • How to replace part of a String with another String :s ?

    Got a String
    " Team_1/Team_2/Team_3/ "
    And I want to be able to rename part of the string (they are seperated by '/'), for example I want to rename "Team_3" to "Team C", and "Team_1" to "Team A" while retaining the '/' character how would I do this?
    I have tried using String.replace(oldValue, newValue); but this doesnt work, any ideas?

    What do you mean that it doesn't work? You do know that the method returns the modified string? The actual string that you invoke the method on is not altered.
    /Kaj

  • Converting part of the string to a date and subtract with sysdate.

    HINT! In order solve this you must know how the pnr is assembled. Study this:
    650323-5510, we only need the first six characters. They inform us about when the person (car owner) was born. In this case it is 23 Mars 1965. You have to use several oracle built-in-functions to solve this. Hint! Begin by converting part of the string to a date and subtract with sysdate.
    select to_char(to_date(cast(pnr,'YYMMDDMM'))) from car_owner;
    please what am i doing wrong. i need the result to be something like this
    Hans, Rosenboll, 59,6 years.

    Hi.
    The main problem here is you have only last two digits of year. That could be the problem in a couple of years from now, when somebody born after 2k would get in to your database. For now if we ignore this problem the right solution would be :
    <code>
    SELECT months_between(trunc(SYSDATE),
    to_date('19' || substr('650323-5510',
    1,
    6),
    'YYYYMMDD')) / 12 years_old
    FROM dual
    </code>
    Suppose you are expecting the age of the car owner as a result above code will give you that. One again notice the '19' I appended.
    Best regards.

  • How to replace a character in a string with blank space.

    Hi,
    How to replace a character in a string with blank space.
    Note:
    I have to change string  CL_DS_1===========CM01 to CL_DS_1               CM01.
    i.e) I have to replace '=' with ' '.
    I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp_fill_string WITH ' '</b>
    Its not working.

    Hi,
    Try with this..
    call method textedit- >replace_all
      exporting
        case_sensitive_mode = case_sensitive_mode
        replace_string = replace_string
        search_string = search_string
        whole_word_mode = whole_word_mode
      changing
        counter = counter
      exceptions
        error_cntl_call_method = 1
        invalid_parameter = 2.
    <b>Parameters</b>      <b> Description</b>    <b> Possible values</b>
    case_sensitive_mode    Upper-/lowercase       false Do not observe (default value)
                                                                       true  Observe
    replace_string                Text to replace the 
                                         occurrences of
                                         SEARCH_STRING
    search_string                 Text to be replaced
    whole_word_mode          Only replace whole words   false Find whole words and                                                                               
    parts of words (default                                                                               
    value)
                                                                               true  Only find whole words
    counter                         Return value specifying how
                                        many times the search string
                                        was replaced
    Regards,
      Jayaram...

  • 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);

  • CS3: grep search to replace part of a string

    Can I do a grep search for a string of text but only replace a portion of the string while leaving the remainder intact?
    iMac G5, OS 10.5.5

    In addition to Eric:
    Find "some search string", Replace "some replacement string " also replaces part of the string, not touching anything...
    But the GREP search has two advantages: First, if you define formatting in the Replace field (italics, superscript, a character style), only the 'search'/'replacement' part will be affected, rather than the entire found string (as in regular search).
    The second big advantage is you can use any regular GREP single character wildcard in the 'left' and 'right' (matching-but-not-marking) parts. A few useful examples: '\d' (digit), '\l' and '\u' (lowercase and uppercase), '.' (any character), or even '[a-f]' (lowercase 'a' to 'f'). The only limitation is that you cannot use the once, zero-or-more, or once-or-more modifiers -- the strings must have a fixed length. FYI, those three modifiers are, respectively, ?, *, and +.
    This restriction does not apply to the 'middle' string, the one you are going to replace anyway -- use whatever GREP you want.

  • Extracting part of a string with a delimiter

    Hi.  Is there a function that can take the string below, and extract EITHER everything to the left OR the right of the " | " separator?  I have many string fields with the same format and need to split them apart.  They all contain the same separator but I haven't come across anything that works.
    Thanks.
    "Communication  | 6. Invites feedback, discussion and/or suggestions about his/her own ideas and assumptions"

    Hi, 
    You can use the Split function.  This will convert your string to an array with a defined seperator like:
    StringVar myString;
    myString := "Communication | 6. Invites feedback, discussion and/or suggestions about his/her own ideas and assumptions"
    Split (myString, "|") [1];
    This will retrieve the first element in the array which is "Communication ". 
    Good luck,
    Brian

  • Error 5 occurred at Open/Create/Replace File in Write spreadsheet String.vi

    Hi everyone,
    can anyone help me with this problem?
    "error 5 occurred at Open/Create/Replace File in Write spreadsheet String.vi "
    I've been using this part of the program for over a year an suddenly this error occures. But not always, mainly at the very beginning of my tests when the file should not be open.
    Info: I'm using a realtime PXI-System. Maybe the amount of data can cause the problem? (about 2MB)
    Grüße
    Meike
    Attachments:
    writeResults.jpg ‏345 KB
    error5.jpg ‏52 KB

    Hi Meike,
    is the file opened by a different program? Do you try to access it by FTP in parallel to your VI?
    You could use basic file functions instead of WriteSpreadsheetFile. That way you could open the file before starting the loop, keep it open all the time and close it once you're finished - with the added benefit of easier error handling…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Access Exchange Service From SharePoint 2013 Custom Web part getting The request failed with HTTP status 401: Unauthorized.

    I want to Fill a drop down with Outlook Meeting of Current log-in user in SharePoint 2013 web part for default credentials I am using the following code
     ExchangeServiceBinding binding = new ExchangeServiceBinding();
                ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
                binding.RequestServerVersionValue = new RequestServerVersion();
                binding.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2010_SP2;
                binding.PreAuthenticate = true;
                binding.UseDefaultCredentials = true;
                binding.Credentials = CredentialCache.DefaultCredentials ; 
                string server = "https://*********/ews/Exchange.asmx";
                binding.Url = server;
    I Am Getting the Error "The request failed with HTTP status 401: Unauthorized."
    but when I Replace  the line  
    binding.Credentials = CredentialCache.DefaultCredentials ; 
    with 
     binding.Credentials = new NetworkCredential(userName, password, domain);
    Its run fine.  Is there any way I could able to use default credential.
      

    Hi,
    As this question is more relate to Exchange development, I suggest you post it to the corresponding forum, you will get more help and confirmed answers from there.
    http://social.msdn.microsoft.com/Forums/office/en-US/home?category=exchangeserver
    Best regards
    Patrick Liang
    TechNet Community Support

  • Name cannot begin with the '\"' character, hexadecimal value 0x22

    I am trying to create Calculated Column in SharePoint Document Library using Client Object Model.
    However getting following error while executing FieldSchema:
    Name cannot begin with the '\"' character, hexadecimal value 0x22
    Code:
     var calculated = "Calculated";
     var displayName = "Effective Date";
     var internalName = "Effective Date";
     var formula = "=IF(ISBLANK(Col_DocumentEffectiveDate),\"\",TEXT(Col_DocumentEffectiveDate,\"DD-Mmm-YYYY\"))";
     List lib = clientContext.Web.Lists.GetByTitle(docLibName);
     clientContext.Load(lib);
     clientContext.ExecuteQuery();
    string fieldSchema = "<Field Type=\"" + calculated + "\" DisplayName=\"" + displayName + "\" Name=\"" +internalName+ "\" Formula=\"" + formula + "\"
    />";
    lib.Fields.AddFieldAsXml(fieldSchema, true, AddFieldOptions.AddFieldInternalNameHint);
    clientContext.ExecuteQuery();
    Code does't work if i replace quotation marks("\) in Formula with "&quot;"
    Could someone help with issue?

    Hi,
    I suggest you take the code below which works in my environment to do the test again:
    ClientContext clientContext = new ClientContext("http://sp/");
    List list = clientContext.Web.Lists.GetByTitle("List2");
    FieldCollection fields = list.Fields;
    clientContext.Load(fields);
    clientContext.ExecuteQuery();
    var displayName = "Cal2";
    var formula = "=IF(ISBLANK([Created]), \"\" , TEXT([Created], \"DD-Mmm-YYYY\"))";
    var fieldSchema = "<Field Type='Calculated' DisplayName='" + displayName + "' ResultType='Text'><Formula>" + formula + "</Formula></Field>";
    fields.AddFieldAsXml(fieldSchema, true, AddFieldOptions.DefaultValue);
    clientContext.ExecuteQuery();
    Feel free to reply if the issue still exists.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Regular expression - Replace a part of an expression

    Dear All,
    This is not a business requirement, just trying to practice regexp.
    Suppose we want to replace a part of a regular expression from a string. As an example, in the string 'THIS Number 124356 Is to Change.This Number 5 Also', I am trying to replace the last digit of each number with $ sign.
    Output will be
    'THIS Number 12435$ Is to Change.This Number $ Also'.
    Will this be possible using a single regexp_replce?
    Thanks in advance.

    MichaelS wrote:
    I am trying to achieve this using a SINGLE regexp_replace.Here we go:
    SQL> with t as (
    select 'ABC124556def568gh236klJ258' str from dual union all
    select 'THIS Number 124356 Is to Change.This Number 5 Also' str from dual
    select str, regexp_replace(str, '(\d{0,})\d{1}', '\1$') str2
    from t
    STR                                                     STR2                                                  
    ABC124556def568gh236klJ258                              ABC12455$def56$gh23$klJ25$                            
    THIS Number 124356 Is to Change.This Number 5 Also      THIS Number 12435$ Is to Change.This Number $ Also    
    2 rows selected.
    Nice..
    Learning for me ..
    Never thought of usage like {0,} ... kepping the end value OPEN.
    I was trying with \d+?\d, which was not working..

  • Checking an int that can begin with 0 for length

    I'm new to Java, so I may be overlooking an obvious solution, but for the life of me I can't figured it out. If I have an int that needs to be a certain length, say 6, how can I check it for length when it can begin with 0?
    If I could assume it would never begin with zero, I would just check to see if the number were larger than 99999. If it were, it would be six digits. However, I can't do a check like that if the user decides to type in 09999 :(

    Nalif wrote:
    Right - All real 5 digit numbers are between 10000 and 99999. If we're looking at palindromes, though, wouldn't 01210 also be five digits? That's not a number. It's a string.
    So if I were to be making a palindrome program that took in five digit numbersPalindromicity applies only to strings, not to numbers. The fact that the string 0120 happens to be composed only of decimal digits is irrelevant. Numbers don't have a "forward" and "backward".
    , it should be able to accept numbers with 0 being the first number, and that was my problem - The book has only just touched on strings, so I'm pretty sure that's beyond the scope of what it's wanting me to do. The question should have just been more precise by saying that it should be assumed that an entered palindrome will never begin with zero. There's no way to do what you want in Java without strings. And strings are a fundamental part of Java that you'll be dealing with every time you touch a Java program, so you might as well learn them.

  • Grep to replace only part of the found text

    I'm using ^.+~> to search the begging of a paragraph up to an EN space, but is it possible with GREP to format just PART of the string found?
    There are roman numerals that precede a period and an EN space and I want to apply formatting to just the roman numerals, leaving the period and EN space alone.
    I did found one post that mentions using "some" but I'm not familiar enough with GREP to know how it works.
    Can anyone commend a good source for GREP coding?
    Thanks,
    Ken

    Try this:
    ^(.+)(?=\.~>)
    I just changed your original code to use the period and en-space as a positive lookahead -- it'll only find characters at the beginning of the line if they're followed by a period and an en-space, but will not include them as part of the found text.
    If these items all have the same paragraph style applied to them and that style isn't used anywhere that you wouldn't want the formatting, I'd also consider setting this up as a GREP style. You could also do it as a nested style applying your character style up to (.~>). (Don't include the parantheses - I was just trying to make it clear what the expression to use is.) 
    Hope that helps.

Maybe you are looking for

  • How do I set up my printer dialog in Quark 6 to make an Acrobat .ps file?

    Before I re-installed all of my system and application software, I would simply go to the Print dialog in Quark (6.5) and choose Adobe PDF and make a .ps file which I would then distill. I can't figure out where the Postsctipt file is now or how to a

  • Updated to usb 2.0, having issues with the zen microph

    basically, put a new usb 2.0 card thing in my computer and when i plug my zen microphoto to it i get a message saying that i need to install the drivers for it, which i can't find online and don't have the cd for anymore. My Zen Nano Plus works fine

  • How do i disable color managment Pro-100

    This printer has been nothing but a headache and I'm not sure how others can get it to work...anyway. The problem is the color(specificly oranges and red). It's way off from the color on my monitor. So, I purchased a ColorMunki Dispaly and calibrated

  • Helvetica fonts in Firefox looks ugly

    Hello my friends, though i am happy with Arch and my fonts looks great, in firefox 7 those pages that use helvetica looks kind of strange. This is how it looks in Chromium This is how it looks in Firefox I've installed w7-fonts,  and the next code in

  • New Business Components doesn't load with their foreign keys

    Hi, When your database schema has already been defined and nothing moves, the creation of Business Components in JDeveloper works pretty well. When you are developing a real application and sometimes the customer changes his mind or something, you ha