Urgent need help with String Manipulation

Hello;
I really need help with strings.

Let's say I have these channels:
\\ABC\DEF\GHI\xyz\xyz\xyz\xyz

\\ABC\DEF\GHI\xyz\

\\ABC\DEF\GHI\xyz\xyz\xyz\

\\ABC\DEF\GHI

\\ABC\DEF\GHI\

ABC/DEF/GHI/xyz/xyz/xyz/xyz

ABC/DEF/GHI/xyz /.

ABC/DEF/GHI/xyz/xyz/xyz /.

ABC/DEF/GHI

ABC/DEF/GHI.

I need to convert them using a SQL statement for:
\\ABC\DEF\GHI\xyz\ or //ABC/DEF/GHI/xyz/ according to the original management / or \. Please note that the "xyz" may be repeated zero or more times. I just need one end with a trailing / or -if she had one first.

I'm on Oracle 11.1.6 SE. I have a bunch of attempts with instr, substr and replace, but I think that regexp_replace could be better.
Any help would be GREAT! I have a whole team waiting on me.

Hello.

Here is a way.

-----------------------------------------------------------------------
with sample_table as
(
     select '\\ABC\DEF\GHI\xyz\xyz\xyz\xyz' str from dual union all
     select '\\ABC\DEF\GHI\xyz\' from dual union all
     select '\\ABC\DEF\GHI\xyz\xyz\xyz\' from dual union all
     select '\\ABC\DEF\GHI' from dual union all
     select '\\ABC\DEF\GHI\' from dual union all
     select '//ABC/DEF/GHI/xyz/xyz/xyz/xyz' from dual union all
     select '//ABC/DEF/GHI/xyz/' from dual union all
     select '//ABC/DEF/GHI/xyz/xyz/xyz/' from dual union all
     select '//ABC/DEF/GHI' from dual union all
     select '//ABC/DEF/GHI/' from dual
)
select str,
     regexp_replace(str,'(xyz([/\])*)+$','\1') new_str
from  sample_table;

STR                      NEW_STR
------------------------------ ------------------------------
\\ABC\DEF\GHI\xyz\xyz\xyz\xyz  \\ABC\DEF\GHI\xyz
\\ABC\DEF\GHI\xyz\            \\ABC\DEF\GHI\xyz\
\\ABC\DEF\GHI\xyz\xyz\xyz\     \\ABC\DEF\GHI\xyz\
\\ABC\DEF\GHI                 \\ABC\DEF\GHI
\\ABC\DEF\GHI\                 \\ABC\DEF\GHI\
//ABC/DEF/GHI/xyz/xyz/xyz/xyz  //ABC/DEF/GHI/xyz
//ABC/DEF/GHI/xyz/            //ABC/DEF/GHI/xyz/
//ABC/DEF/GHI/xyz/xyz/xyz/     //ABC/DEF/GHI/xyz/
//ABC/DEF/GHI                 //ABC/DEF/GHI
//ABC/DEF/GHI/                 //ABC/DEF/GHI/

Kind regards.

Tags: Database

Similar Questions

  • Urgent need help with find and change / GREP

    I'm working on a manual that contains more than a thousand paintings. I'm not quite familiar with GREP and need help to determine the right to coding/jokers to change the character style to a group of words/numbers on a global basis.

    For example, in Chapter 7, a paragraph style is applied to this line of text:

    TABLE 7.1: T4, T3, FREE T4 AND FREE T4ED

    I need to change "table 7.1:" for a character style and so of suite/so on up to "Table 7,150:"-while leaving the other numbers on the same line unchanged also.»» Is it possible to do without having to manually each table style number?

    gd247 wrote:

    I'm working on a manual that contains more than a thousand paintings. I'm not quite familiar with GREP and need help to determine the right to coding/jokers to change the character style to a group of words/numbers on a global basis.

    For example, in Chapter 7, a paragraph style is applied to this line of text:

    TABLE 7.1: T4, T3, FREE T4 AND FREE T4ED

    I need to change "table 7.1:" for a character style and so of suite/so on up to "Table 7,150:"-while leaving the other numbers on the same line unchanged also.»» Is it possible to do without having to manually each table style number?

    No need for GREP. If "TABLE 7.1:" is text, you can create a nested character style that extends through the colon, in the paragraph style. "

    If "TABLE 7.1:" is created by a numbered list of automatic type paragraph style, you can specify a character style named for the part of automatic numbering in the drop-down menu Style of character, in the Style of numbering of the chips section and numbering of the dialog box Options of paragraph style. If the character style does not exist, you can stay in the operation of paragraph options by choosing 'New Style of character' in the menu. After you create the new style, you're back in the process of definition of the paragraph.

    HTH

    Kind regards

    Peter

    _______________________

    Peter gold

    Know-how ProServices

  • Newbie need help with string concatenation function.

    I'm totally new to LabView and am trying to work on a project that someone worked in the past.  I came to a string function concatenated on one of the existing provisions and only seen on some entries of the string function has an order of 'rel' and 'g '.  I don't know if it's a common command or what it is.  This is VI is that it requires a user to enter a base dimension (x-axis starting point and end point) and executes the steps in the sample desired within the "point of departure" and "end point".  "a3" is the name of the x-axis.  but I'm not sure of the meaning 'rel' and 'g '.  I posted part of the diagram.  Any help would be appreciated.  Thank you!

    This isn't a question of LabVIEW, but very specific to the device connected to the other end of the serial port. Do you have any documentation for it?

    Basically, the program needs form a consiting of command of a delimiter character, value and end of key word, etc. for example.

    Who wrote this program. It seems too complex and convoluted. Under certain conditions, it seems to send two commands at the same time, and there is no way to determine the order in which they run. Maybe it doesn't matter, but maybe it does. Most likely, what you need is a single structure dealing with a case for each condition and a unique series in the end writing. You can reach the actual program? There are also a lot of duplicate code. What is the purpose of the operations 1 x? Is this a Subvi?

  • Urgent need help with MD3000i

    Got 4 units MD3000i and they were great for 5 years.

    Perform maintenance on the switches and power to one of our media.

    Have a 2 nodes and MD3000i for our SQL cluster.

    Power off both nodes of the cluster SQL while rewiring of SAN switches. We leave on the MD3000i chassis, but I do not think that this could be a problem.

    Subsequently realised could not contact the management for SAN ports.  This is not uncommon and usually a stop and restart did the trick.

    In this case off the power to the chassis, powered back and two controllers just restart before initiallizing the iSCSI port.  They ping, but software cannot connect before they reset again. Used the serial cable and watched the boot process, lists a panic - irreconcilable ITA database before they reset.  Can't find anything about a database of the ITA.

    Tried to use one or the other cards but no difference.

    Finally pulled the readers and it would be starts fine but show no group of disc or anything.

    Even with a drive in the chassis, it would go back to the problem.

    Biggest problem is that we discovered the most recent backups of our SQL production was on another partition on the SAN.

    Really be a life saver if anyone can point me to something more to try or a guru.

    Yah Justin with Support Dell has helped me get all fixed.

    He thought it could have been older firmware, or a drive problem just in the right place.

    That is the process.

    Went to my install MDSM and got the csv files in file recovery. Only in the case, but I didn't need.

    Shoot all the readers and connections but management

    put in 2 new drives (slot0, 1) who had not been a MD3000i before and had no database configuration on them

    initialization of map main made sure that it was successful, then added the secondary card

    Once it was up and working on the 2 discs

    begin to insert the original box 3-14 disks one confirming that each of them has been detected and work.

    Then replace location 0 car with original and finally slot 1

    At this point, the software has seen original disk groups and we were able to do an import of my 2 groups

    Then updated to the latest firmware on controllers and disks

    At this time, he had to reconfigure iscsi connections and host groups

    Good to go.  My faith in the units has been restored.

  • Need help with strings

    How to turn the string myName myName_btn?

    And can you give a link or tell me where I can find the current manual for Flash CS4?

    Thank you

    var var1:String = "myName_btn";

    var var2:String = var1.split ("_") [0];

    and check the comments here:

    http://evolve.reintroducing.com/2008/10/24/News/Adobe-Flash-CS4-F1-help/

  • Simple problem: need help with string functions

    I'm sure it's easy, but it's late and I'm tired.

    If I had a string that contained a full name for example.
    < cfset name = 'John Smith' >

    How would manipulate the string so I could separate in two variables for example.
    FirstName = 'John '.
    LastName = 'Smith '.

    See you soon

    Swampie says:
    > How would manipulate the string so I could separate in two variables for example.
    > firstname = 'John '.
    > lastname = 'Smith '.

    pretend it's a list delimited by spaces.

    name = 'Jane Doe';
    Switch (listLen (name,"" ")) {}
    case 1:
    manage single names
    break;
    case 2:
    firstName = listFirst (name,"" ");
    lastName = listLast (name,"" ");
    break;
    case 3:
    firstName = listFirst (name,"" ");
    middleName = listGetAt ("name, 2," "");
    lastName = listLast (name,"" ");
    break;
    } / / switch

    probably need a break by default for > 3 names.

  • Urgent need help with access to the scene.

    I want to access the video clips that are nested inside of each other and I want to access the main theater of my project when it was created, but I can't do that with Actionscript 3. How do I access the root of my project?

    You can reference the root or the main timeline to use anywhere:

    MovieClip (root)

  • I'm suddenly needing help with my browser Firefox (6.0.2)

    Hello
    I'm suddenly needing help with my browser Firefox (6.0.2)

    (OS: I use Windows XP).

    When I open the browser, I don't see is a totally white screen of white, with all the toolbars at the top.

    I know that my physical connections are very good: I have tested the modem, turned the pc market etc and I can also receive/send emails.

    This problem started today, September 8, 2011 and has never happened before.

    Is it a coincidence that Firefox itself to day before I disconnected yesterday evening? Could this be something to do with this particular new update?

    I also noticed that just before I "opened" Firefox, I now get a small box indicating:

    [JAVASCRIPT APPLICATION]
    Handl exc in Ev: TypeError: this oRoot.enable is not a function

    This never appeared before - I hope that it offers a clue has what is wrong.

    The browser not be stuck in Mode safe, said by the way.

    Of course, I can't find solutions to the problem on the internet, I don't physically see all Web sites!
    (A friend sends this request in my name from their pc)

    Any light you can throw on this problem of confusion would be much appreciated. I'd rather not have to uninstall and reinstall Firefox if possible.

    If the only option is to uninstall Firefox and reinstall from your site, I'm also in trouble (I can not see the internet or download).
    In this case, would you be able to send the .exe file as an attachment to my e-mail address? In the affirmative, please let me know and I'll give you more details.

    Thanks in advance.

    One possible cause is security software (firewall) that blocks or limits Firefox or plugin-container process without informing you, possibly after the detection of changes (update) for the Firefox program.

    Delete all rules for Firefox in the list of permissions in the firewall and leave your firewall again ask permission to get full unlimited access to the internet for Firefox and the plugin-container and the update process.

    See:

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • Need help with installation on Photosmart C7280 all-in-one

    I had my printer is installed and has been using the printer for 3 wireless laptops in my house.  Now, I can't even find my backup drive, so I have need help with downloading the software to use my printer and also get to use wireless.   I don't know what happened, but the fax for this printer is listed, but not the printer itself.   Help, please!

    Click here to download the software for your printer:

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?product=3204785 & LC = on & CC = US & DLC = in & lang = to & CC = US

    has chosen the appropriate operating system that corresponds to your computer and download the full software features.

  • HP laptop: need help with internet and search for things

    whenever I'm on chrome internet explore google ect and go to tab it is says unknown error or no internet connection or anything and just takes me chrome ect. I need help with this im involved in a byod class and my computer won't let me on what whatever usually it just starts out black and white and the seeds I my search request

    Yes it's a Windows 10 and it arrived already installed I'll take the other info now

  • Need help with the installation of an adapter of Palit GeForce 9500GT Super chart - 512 MB in a M2N68 (narrated

    Need help with the installation of an adapter of graphics Super Palit GeForce 9500GT - 512 MB - DDR2 SDRAM in a M2N68 motherboard (narra6). Should I disable the onboard graphics in the bios? When the card is installed, no VGA work outs and the PC does not start. Checked and recontroler implementation of the card in the PCI slot. PC is a desktop HP G5200uk PC. Windows 7 operating system.

    Hello

    The link below is a guige to install a video card in your Pc.  In particular, it seems that you will have to perhaps specify the location of the new card in the bios and save this change before you install the new card - see step 4 in the guide on the link below.  If your new card fits into the PCI Express x 16 slot, you will need to define PCI Express in the bios and save the changes.

    http://support.HP.com/us-en/document/c01700855

    Kind regards

    DP - K

  • need help with my window is in thai and I do not understand to all.how to convert to English?

    need help with my window is in thai and I don't quite understand.
    How to convert to English? I tried for days but still it cannot be changed.
    because I can't read thai... Please help me step by step...

    my pc is touchsmart 9100 windows 7 Professional.

    Not a single word is in English if I go to the "region and language" to change.

    Everthing is in thai in the system.

    Hello

    Where have you bought the PC?

    What is the operating system installed?

    Best regards

    ERICO

  • I need help with an installation failure to interpret and troubleshoot a Setup log.

    Background: A few years ago, many editors of cinema used Final Cut Pro 6 (also contained in Final Cut Studio 2) for their editing projects.  Shared Apple Final Cut X uses a different format that is not compatible with FCP6.  Sometimes, these editors are called to work on a few historical projects that have been published in FCP6 and need this version to run now.

    Starting with OS X Lion, FCP6 would install not in Lion and thereafter.

    According research by Jeremy Johnston as noted on his blog, he discovered that Apple has inserted a file in the folder CoreServices in the Library folder of the system folder that causes versions the version Final Cut Pro X (and other older Apple programs in the same situation) do not settle.  He suggested changes to this file that would seek to prevent interfering with the installation of FCP6 in Lion, many users of final cut PRO 6 were successful in their efforts to install in Lion and work with it.

    Later in a discussion update on installing FCP6 in Mavericks, HawaiianHippie determined that the simplest way to perform the installation of FCP6 was simply copy this file and remove it from the system folder, install FCP6 and then restore the copied file:

    https://discussions.Apple.com/message/26309669#26309669

    I used this method with success to install FCS2 in Yosemite:

    [click on images to enlarge]

    However, in my attempts to install FCS2 in El Capitan, it fails in the last 5% to install the first DVD:

    First of all, I need advice on how to display an extremely large Setup log in this thread (on MacRumors, it is a method to insert a 'code' in a small box that can be the object of a scrollbar if necessary to read all along).  I am unable to find such a method to post here.

    Then once approved, I need help to determine which component is causing the installation to fail and perhaps this element can be omitted from the installation:

    If this element is not required, then maybe FCP6 can be installed successfully without it.  And if that omitted element is necessary, perhaps a manual method to install it can be determined by pacifists.

    It is my goal to help those who need to install and use FCP6 on their new Macs running El Capitan.

    Here is the post on MacRumors with pre-installed Setup log:

    http://forums.MacRumors.com/threads/i-need-help-with-an-installation-failure-to-interpret-and-troubleshoot-an-Installer-log.1954786/#post-22541389

  • Need help with the port forwarding for a XBox remote Streaming

    I have a router R6200v2 and need help with port forwarding.

    I came across this set of instructions for setting up stream port forwarding XBox remotely from anywhere

    http://kinkeadtech.com/2015/07/how-to-stream-Xbox-one-to-Windows-10-from-anywhere-with-Internet/

    I have no idea when it comes to such things and I want to make sure I do it correctly without messing up my existing home network.

    Port Forwarding and triggering Port pages setup look very different from what the guy uses. Can someone walk me through what I do to set up please?

    Hi @varxtis,

    You must enter them in the field for a start external Port and external completion Port. You will need to send individually except for the range of 49000-65000. The steps are as follows.

    1. create a Service name (it could be something else that you cannot use the same service name twice. Ex. XBOX1, XBOX2 and so forth.)

    2. Select the type of service (TCP, UDP or both)

    3 entry 5050 times a start external Port and external endpoints.

    4. Select the IP address of your XBOX.

    5. Select apply.

    6 do the same for other port numbers. To the beach, use 49000 for the external departure Port and for the external completion Port 65000.

    Kind regards

    Dexter

    The community team

  • Need help with network home using Airport extreme

    I need help with my home network.  I'm not very aware when it comes to all things network.  Here's how my network is currently set up.

    Cable modem to Airport Extreme for Gigabit Switch.  Cables come out of the switch to all areas of the House.  I have 2 other extreme airport connected in other rooms of the House directly on the wall that dates back to the switch.  I hope I am explaining that properly.

    My problem is that this seems to have caused some of my connections cable does not work.  When everything is configured, it has worked well.  All connections in the House worked.  Then we have disconnected one of the extreme airport and moved to another location in the House to have the best wifi coverage.  Since that time, a lot of the ethernet wall plugs are not working.  For example, when I plug in my Macbook Pro in making ethernet in my kitchen, it says connected but it has an assigned ip address and cannot connect to the internet.

    Any help you can provide would be great.

    I would like to get the return tech to help you to...

    But it is likely that something (or someone) has tampered with the settings.

    The layout is fine... but you can cause problems with the network by creating a loop.

    This can happen because the AE you moved is connected wrongly... somewhere in the network it is connected to the switch again.

    Or AE is set to expand wireless... It's FAKE... It will loop the network on the back main EI wireless.

    Unplug the two AE you have that function as extensions...

    Turning off everything else... then it works again...

    Do it in this order.

    Modem... Wait 2 min

    AE... Wait 2 min

    Switch.

    Now check that the network is working properly... power of customers in various locations and make sure everything is good.

    If so, then manually reset the two AE of factory and redo their installation.

Maybe you are looking for

  • Photos and iPhoto Library - transfer both?

    Hello. I'm trying to transfer my library of Photos on an external hard drive to free up space on my Mac. I noticed there is a huge iPhoto library in both images and don't know what to do with it. I'm running OS X El Capitan 10.11.5 and was completely

  • Cold start problem

    my macbook is mid pro model 2012 and every morning I can't start. It stops with a clicking sound. I filmed a video https://youtu.be/Ar__HxMZrEI

  • Photo privacy

    I have some pictures on my phone that I want to keep private of curious people looking through it. is their some way too block my photos or put a code on my SD card, or something of the sort to keep my private photos? I have a motorola cliq

  • HP Color LaserJet CP1215

    A year ago, the right side of the printed page was fuzzy when printing in color. (the black and colors were neither Kaleidoscope)  I called HP and was told that I needed a new printer, but I came to buy more cartridges so I changed the controls in or

  • I get the error code 80070005 when I try to search for updates by using Windows Update.

    I use Windows Vista Home Premium with Service Pack 2.  I tried to run hard, but that has not solved the problem.