Delete a string part and replace by another one

Hi,
How can i delete a part of my string ?
Thx

REM ========== script T1.sql =============================================
set verify off
def A='0.000;0.000;1.000;'
def B='0.000;'
def C='2.000;'
def occ=2
select
       '&A'  OLD
      ,substr('&A' , 1, instr('&A','&B', 1, &occ) - 1)          X1
      ,substr('&A' , instr('&A','&B', 1, &occ),  length('&B') ) X2
      ,substr('&A' , instr('&A','&B', 1, &occ) + length('&B') ) X3
      ,   substr('&A' , 1, instr('&A','&B', 1, &occ) - 1)
       || '&C'
       || substr('&A' , instr('&A','&B', 1, &occ) + length('&B')) NEW
  from dual
REM ======================================================================
SQL> start T1
OLD                X1     X2     X3     NEW
0.000;0.000;1.000; 0.000; 0.000; 1.000; 0.000;2.000;1.000;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Search given string array and replace with another string array using Regex

    Hi All,
    I want to search the given string array and replace with another string array using regex in java
    for example,
    String news = "If you wish to search for any of these characters, they must be preceded by the character to be interpreted"
    String fromValue[] = {"you", "search", "for", "any"}
    String toValue[] = {"me", "dont search", "never", "trip"}
    so the string "you" needs to be converted to "me" i.e you --> me. Similarly
    you --> me
    search --> don't search
    for --> never
    any --> trip
    I want a SINGLE Regular Expression with search and replaces and returns a SINGLE String after replacing all.
    I don't like to iterate one by one and applying regex for each from and to value. Instead i want to iterate the array and form a SINGLE Regulare expression and use to replace the contents of the Entire String.
    One Single regular expression which matches the pattern and solve the issue.
    the output should be as:
    If me wish to don't search never trip etc...,
    Please help me to resolve this.
    Thanks In Advance,
    Kathir

    As stated, no, it can't be done. But that doesn't mean you have to make a separate pass over the input for each word you want to replace. You can employ a regex that matches any word, then use the lower-level Matcher methods to replace the word or not depending on what was matched. Here's an example: import java.util.*;
    import java.util.regex.*;
    public class Test
      static final List<String> oldWords =
          Arrays.asList("you", "search", "for", "any");
      static final List<String> newWords =
          Arrays.asList("me", "dont search", "never", "trip");
      public static void main(String[] args) throws Exception
        String str = "If you wish to search for any of these characters, "
            + "they must be preceded by the character to be interpreted";
        System.out.println(doReplace(str));
      public static String doReplace(String str)
        Pattern p = Pattern.compile("\\b\\w+\\b");
        Matcher m = p.matcher(str);
        StringBuffer sb = new StringBuffer();
        while (m.find())
          int pos = oldWords.indexOf(m.group());
          if (pos > -1)
            m.appendReplacement(sb, "");
            sb.append(newWords.get(pos));
        m.appendTail(sb);
        return sb.toString();
    } This is just a demonstration of the technique; a real-world solution would require a more complicated regex, and I would probably use a Map instead of the two Lists (or arrays).

  • Calendar deleted and replaced by another one

    Hello,
    My brother sent me his schedule but I guess he sent me the whole calendar because when i accepted it. It deleted my own and put his as a replacement.
    Can i get back my old calendar?
    Thanks

    First of all if you are really worried when you connect the phone to your computer go to the device summary page in iTunes and change to manually manage the device so that you are in control of what goes on to it.
    A synch will transfer purchased items from device to computer and they are always available to re-download from 'the cloud'.  Once you have the songs on your computer I do suggest that you burn them to CD or back them on to an external hard drive as sometimes items are withdrawn from iTunes so you can no longer re-download.  Indeed the terms and conditions we are all accepting today with the IOS7 update specifies that it is our responsibility to back items up.
    So as long as the songs you have already purchased are still available on iTunes, you can download them again should they disappear.

  • A family member has given me her iPhone. How do I delete her Apple ID and replace it with my own

    A family member has given me her iPhone. How do I delete her Apple ID and replace it with my own ?

    Any Apps that have been downloaded with her Apple ID will remain Tied to that ID...
    You should consider doing a Restore as New and start over with your ID...
    Connect the Device to the iTunes library on your Computer, click on the Device tab that appears in iTunes and click Restore.
    http://support.apple.com/kb/HT1414

  • How do you delete incorrect cover art and replace it with the correct cover art?

    How do you delete incorrect cover art and replace it with the correct cover art?

    Select the song and open the "Get Info" window (Cmd + I or File > Get Info).  Select the artwork tab.  Select the artwork and click the "Delete" button.  Use the "Add" button to select the replacement art or just drag it into the window.  Click "OK" to save your changes.

  • TS4009 I have had to delete my icloud account and open up another because it would not verify. In the meantime I have lost my storage which was attached to the previous email account. I would like to know how I can transfer it across to my existing accoun

    I have had to delete my icloud account and open up another because it would not verify. In the meantime I have lost my storage which was attached to the previous email account. I would like to know how I can transfer it across to my existing account?

    Thanks randers4. Reading through other discussion points, other people have similar problems. I thought and still do, that the easiest option was to delete and open up another. That worked fine except I remembered that I had some storage attached to that icloud address. I live in New Zealand.

  • HT1766 I tried to add music from my sons ITunes, instead it deleted all my information and replaced it with all my sons info can I get my information back on my phone? HELP

    I tried to add music from my sons ITunes, instead it deleted all my information and replaced it with all my sons info can I get my information back on my phone? HELP

    Each Apple ID has it's own library in iTunes.  If you tried to sync his music to your device, then it will not only wipe your information on your phone, but can affect your sons.  Make sure you are logged into iTunes with your Apple ID and restore your device from a previous backup.

  • My iPod fall from me last night, and it's front glass broken what should I do throw my ipod in the trash and go buy another one or there 's a way to fix it. (mind that the ipod is working probably) ipod touch 4

    My iPod fall from me last night, and it's front glass broken what should I do throw my ipod in the trash and go buy another one or there 's a way to fix it. (mind that the ipod is working probably) ipod touch 4

    You'll have to get it serviced by Apple, you'll have to pay for the replacement device:
    Apple - Support - iPod - Repair pricing
    Apple - Support - Service Answer Center
    You can also search for a 3rd party repair company in the Internet.

  • How do I delete my email address and open a new one?

    How do I delete my email address and open a new one on icloud?  I want the sender of email to receive "account deleted" when they try to send me an email.

    That isn't possible, you cannot delete an iCloud account, you can only stop using it.

  • My Iphone was sync with Itunes on a computer then this computer broke down and i purchased another one. I was able to extract all the data from the old one. now how can i sync my phone with the new tunes without loosing any data?

    My Iphone was sync with Itunes on a computer then this computer broke down and i purchased another one. I was able to extract all the data from the old one. now how can i sync my phone with the new tunes without loosing any data?

    Yes, windows to Mac too.
    iTunes: How to move [or copy] your music [library] to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    Quick answer if you use iTunes' default preferences settings:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Open iTunes and immediately hold down the Option (alt) key (shift on Windows), then guide it to the new location of the library.
    Windows users see tip at: https://discussions.apple.com/message/18879381

  • I delete my iCloud account and got a new one but the previous iCloud account is keep showing up.what do I do??

    I delete my iCloud account and got a new one but the previous iCloud account is keep showing up.what do I do??

    You have to sign out of the old one and then sign back in with the new one. On an iOS device it's Settings>iCloud and click 'Delete account' (this will not delete the account from the server, just disengage the device from it). On a Mac it's System Preferences>iCloud and click 'Sign out'.

  • Can I delete a later backup and keep the latest one as to not eat up all my space?

    Can I delete a later backup and keep the latest one as to not eat up all my space?

    Are you talking about Time Machine backups on a Time Capsule?
    It is fine to delete the backup as long as you are sure there is nothing you want.. and do a new clean backup. That will be the least possible space usage for a working backup.. Never delete files out of an existing backup.. it is very hard to manually delete files in the backup.
    We do not recommend it.

  • TS3988 i want to delete my iCloud account and get a new one. but i can not delete as it says that my iphone is being restored. could anyone tell me what would be the solution to my problem. i will be thankful to you..

    i want to delete my iCloud account and get a new one. but i can not delete as it says that my iphone is being restored. could anyone tell me what would be the solution to my problem. i will be thankful to you..

    You can go to icloud.com, open Mail, click on the gear shaped icon on the upper right and choose preferences, go to the Vacation tab and set up an auto response saying that the account is no longer in use.  Then go to Settings>iCloud and turn Mail to Off on your device and stop using the account.
    Incoming email to the account will receive your vacation auto response, and eventually the mailbox will fill up and no longer receive mail at all.

  • Hi everyone. i need to delete me itunes account and start a new one. this is get old pics, msg's etc of my old broken phone. anyone got a step by step ?

    hi everyone. i need to delete my itunes account and start a new one. i dropped my old phone and bought a new one as i could here finger tap noises but couldn't see anything. anyone have a step by step guide to deleting the account ?

    Why do you think you need to delete your iTunes account? Why don't you want to use it for the new phone?

  • I would like to change of type of subscription to improve its level. Should I cancel the first one and then take another one ?

    hello
    I would like to change my type of subscription (adobe reader) to improve to get a higher level. Should I cancel the first one and then take another one ?
    thks
    cecile

    Hi Cecile,
    Please Contact Customer Care; an agent will be able to change your subscription from ExportPDF to Adobe PDF Pack, or an Acrobat subscription.
    Best,
    Sara

Maybe you are looking for

  • Voice mail alert but no messages in voice mail

    Hi - after switching to new service provider I have voice mail message alerts on my blackberry pearl handset but when I go to my voice mail I have no new messages. Any ideas how to delete the message alert? Thanks! Solved! Go to Solution.

  • BI - Exam Questions & Tips

    Hai Friends   I am going to take BI Certification Exam next Week. If any one has got model exam questions or tips about the exam, please write to me at [email protected] Thanks in advance A.Bharath

  • After effects performance issues on mac pro 12-core

    Hello everyone, I feel as if i keep making similar posts to this, but for some reason i am still not satisfied with my machine. Im using a mac pro 12-core 2.4GHz with 40gigs of ram installed and a ATI Radeon 5770 graphics card. I finally got around t

  • COR2 -Rounding Transfer Order Quantities

    Hi, I have a following requirement. When user changes order in COR2 and releases .Materials tab will be having quantities with 3 decimals but my user wants to round it up to a whole number in the transfer order which gets created after saving the tra

  • Oracle error when filter based upon union

    when doing a filter based upon on results of another request i get the following error. error : (Response came back as text, not XML) the saved request i am linking to has unions in it vs being a single request. If i link to a single request it works