A string into the text and numbers using SUBSTR and INSTR
I have the sample data. I know it's terrible database designed for a combination of text and numbers in the same field, but I can't change the business process.
That's what I have so far:
set linesize 5000 WITH table_data AS (SELECT 'R: JASON BOURNE 12341560' str FROM DUAL UNION ALL SELECT 'R: FATS DOMINO 23432342' str FROM DUAL UNION ALL SELECT 'R: MARTIN LUTHER KING 3334156' str FROM DUAL UNION ALL SELECT 'R: TOM CRUISE 6547123' str FROM DUAL UNION ALL SELECT 'R: TOMMY DE GROOT 1212124' str FROM DUAL UNION ALL SELECT 'R: GRIM REAPER 1345245' str FROM DUAL UNION ALL SELECT 'R: DOCTOR DEATH THE FIRST SMITH 24356178' str FROM DUAL) SELECT str , TRIM(SUBSTR(str, INSTR(str, ' ', 1, 1), INSTR (str, ' ', 1, 2) - INSTR (str, ' ', 1, 1))) first_name , REPLACE(SUBSTR(str, INSTR (str, ' ', 1, 2)+1, 999), SUBSTR(str,LENGTH(str)-6,7), '') last_name , SUBSTR(str,LENGTH(str)-6,7) emp_num FROM table_data; STR FIRST_NAME LAST_NAME EMP_NUM ---------------------------------------- ----------------------------------------------- R: JASON BOURNE 12341560 JASON BOURNE 1 2341560 R: FATS DOMINO 23432342 FATS DOMINO 2 3432342 R: MARTIN LUTHER KING 3334156 MARTIN LUTHER KING 3334156 R: TOM CRUISE 6547123 TOM CRUISE 6547123 R: TOMMY DE GROOT 1212124 TOMMY DE GROOT 1212124 R: GRIM REAPER 1345245 GRIM REAPER 1345245 R: DOCTOR DEATH THE FIRST SMITH 24356178 DOCTOR DEATH THE FIRST SMITH 2 4356178 7 rows selected.
I need to:
1 extract the first name - which is always the first name after the 'r' - I've got that little works very well.
2 extract the name - should be the last word before the number, if e.g. for the last night, I wish only that 'SMITH' and 'KING' for the 3rd line and "GROOT" for the 5th line.
3. remove the number at the end, regardless of the length - some of the examples above are 8 long numbers so my attempt above does not work.
I can't use any REGEXP or REGEXP_SUBSTR because they are not registered in the EUL I'm using discoverer, I can only use INSTR AND SUBSTR.
I was wondering if someone might be able to help please?
Any advice much appreciated.
Thank you
AW, go on them, as it's Christmas, I'm feeling generous...
SQL > ed
A written file afiedt.buf1. WITH table_data (SELECT "r: JASON BOURNE 12341560' DOUBLE UNION ALL STR ')
2. SELECT "r: FATS DOMINO 23432342' str OF DOUBLE UNION ALL.
3. SELECT "r: MARTIN LUTHER KING 3334156' str OF DOUBLE UNION ALL.
4. SELECT "r: TOM CRUISE 6547123' str OF DOUBLE UNION ALL.
5. SELECT "r: TOMMY GROOT 1212124' str OF DOUBLE UNION ALL.
6. SELECT "r: GRIM REAPER 1345245' str OF DOUBLE UNION ALL.
7. SELECT "r: DOCTOR DEATH FIRST SMITH 24356178' FROM DUAL str.
8 )
9 select substr (str, 1, instr(str,' ')-1) as a first name
10, substr (substr (str, 1, instr(str,' ',-1)-1), instr (substr (str, 1, instr(str,' ',-1)-1),' ', 1) + 1) as last_name
11, substr (str, instr (str, ' ',-1) + 1) as emp_num
12 years of (select replace (str,'R: ') as str)
table_data 13
14* )
SQL > /.FIRST_NAME LAST_NAME EMP_NUM
---------------------------------------- ---------------------------------------- ----------------------------------------
JASON BOURNE 12341560
FATS DOMINO 23432342
MARTIN KING 3334156
TOM CRUISE 6547123
TOMMY GROOT 1212124
GRIM REAPER 1345245
DOCTOR SMITH 243561787 selected lines.
Tags: Database
Similar Questions
-
Sort the listBox that contains the text and numbers
Is there a script to sort a listBox control that contains the text and numbers using a button?
I would have preferred that he sort 1, 2, 10, 20, 100, not 1, 10, 100, 2, 20
Examples are part numbers: HP1457100-9, 011-2025-479, 85216, etc.
You may need to change this line:
oTarget = this,It refers to the object to display the results.
-
How to add numbers like these on the text and images Indesign
Hi, I would like to know how this is possible (to add numbers with the black circle to refer to an image on the text), when I copy paste I get the number I guess it's a kind of ascii?
Thank you
There are some fonts with numbers, but they have a limit on numbers.
I would create
- Paragraph with your desired font, size, and white color style.
- Create an object with fill blach and in paragraph style select step 1 created a style.
- Draw a circular text frame, apply the style of the object and write the number in there.
- Copy the circle and then insert the tool in the desired location and paste it into the text.
- Lift the text by clicking the ESC key, paste it on the image.
- Adjust the vertical position of the text through a style of object > anchored the parameters of the framework.
-
I have a pdf file that contains the text if I copy all the text and paste it into Notepad and save the .txt file is it changes the ascii value of the text?
If the encoding is ASCII? Laughing out loud
Be well...
-
How the SUM cells including the text and the number?
Hello world
Someone can tell me how the SUM cells include the text and the number?
1 Bob 20
2 30 Jane
3 50 Jame
Total 100
Thank you
Hi Jordan,.
If the numbers are not always two digits, FIND the position of the space between the number and name:
Formula in B2 (fill down)
= FIND("",A2)
Then use the LEFT function to get the number in the column C:
Formula in C2 (fill down)
= LEFT (A2, B2)
This will give a text string (Tip: left-aligned).
Convert to a numeric value in the D column with the VALUE function:
Formula in D2 (fill down)
VALUE = (C2)
(Tip: propped right)
Table 1 has a header row and footer of the line, and the SUM is easy. Formula to the D8 footer line:
= SUM (D)
Kind regards
Ian.
Edit: You can hide columns B and C
Ian.
-
Photo Story 3 blurs the text and format of appropriate background music
I had a lot of trouble with a blurry text on Photo Story 3. It seems perfectly fine to start, and then whenever I saw it, it's blurred beyond belief. In addition, I don't know the type of music format for the background music. What can I do to fix the text, and what file format do I for the background music?
Many different audio formats would work but the best
choice is always WMA or WAV. Sometimes, it can
having problems when you save a project as a result of the use of certain
audio formats.As for your photos... If nothing else... to enlarge a
size at least equal to your screen resolution.That will probably not improve the appearance of the
photos, but it will improve the text (fuzzy) pixelated
problem.First of all, lets you know what is the resolution of your screen. Right
Click your desktop, then choose Properties / Settings tab...
Watch the screen resolution slider to see your current
Resolution of the screen. For this tutorial, let's say your screen
The resolution is 1024 x 768.If you download and install the free Win XP ImageResizer
PowerToy it will add a 'Resize' option to the right click
menu.Can resize the following free PowerToy for Windows XP
lots of photos very quickly:Click on the following link and on the left, click PowerToys...
Windows XP downloads
http://Windows.Microsoft.com/en-us/Windows/downloads/Windows-XP(FWIW... it's always a good idea to create a system)
Restore point before installing software or updates)Download and install: ImageResizer.exe
(Filename: ImageResizerPowertoySetup.exe)
(does not work on Vista)Now you can open any folder containing images and
you will have an option to resize. Just right-click the selected
(highlighted) image files and choose resize images of
the menu. You can select a picture or an entire group.The program puts in the folder with resized copies
your originals.(Tip: * never * crush your originals... especially if you were)
resizing of the originals to a smaller size)Resized copies will the custom word added to the
file name so that they will not be easy to find when you are ready to add
paste them into your photo story project.To ensure that images in the orientation to portrait and landscape
are resized to the same size... go to... Advanced... and
tick... Customize... Enter the largest number in these two areas.IOW... in this tutorial assuming that the screen resolution 1024 x 768...
Enter 1024 in these two areas.The maximum number of Photo Story 3 photos can just a Council...
handle is 300 and if you use a lot of movement and Transitions a
smallest of the numbers is recommended.Well, the next gift can change the duration of the photos
in an existing one. WP3 project... it can also delete... Motion and
Transitions and also randomize the slides.TweakPS
http://www.windowsphotostory.com/TweakPSMore info on the following sites:
WindowsPhotoStory.com
http://www.windowsphotostory.com/PapaJohn
http://Papajohn.org/
See Photo Story 3 in the left columnSee you soon...
-
Input string in the text through business rule beam
Hello, I have a problem I can not enter a string in the text bar using the equation like membername = 'chain' or % membername % = @alias("January"); He entered nothing in the cell or replaces the existing value with #missing, on the other hand I can enter numbers here, but essbase interpreter number to a string. like 1 = AndyEssbase can store only numerical data and business rules are run on the essbase database.
See you soon
John
http://John-Goodwin.blogspot.com/ -
How to enter text in the text entry box using the virtual keyboard in a flex application
Hello
B20.addEventListener (MouseEvent.Click, HandleEvent);
B21.addEventListener (MouseEvent.Click, HandleEvent);
B22.addEventListener (MouseEvent.Click, HandleEvent);
B23.addEventListener (MouseEvent.Click, HandleEvent);
B24.addEventListener (MouseEvent.Click, HandleEvent);
B25.addEventListener (MouseEvent.Click, HandleEvent);
B26.addEventListener (MouseEvent.Click, HandleEvent);
B27.addEventListener (MouseEvent.Click, HandleEvent);
B28.addEventListener (MouseEvent.Click, HandleEvent);
B29.addEventListener (MouseEvent.Click, HandleEvent);
B30.addEventListener (MouseEvent.Click, HandleEvent);
B31.addEventListener (MouseEvent.Click, HandleEvent);
B32.addEventListener (MouseEvent.Click, HandleEvent);
B33.addEventListener (MouseEvent.Click, HandleEvent);
B34.addEventListener (MouseEvent.Click, HandleEvent);
B35.addEventListener (MouseEvent.Click, HandleEvent);
B36.addEventListener (MouseEvent.Click, HandleEvent);
B37.addEventListener (MouseEvent.Click, HandleEvent);
B38.addEventListener (MouseEvent.Click, HandleEvent);
B39.addEventListener (MouseEvent.Click, HandleEvent);
B40.addEventListener (MouseEvent.Click, HandleEvent);
B41.addEventListener (MouseEvent.Click, HandleEvent);
B42.addEventListener (MouseEvent.Click, HandleEvent);
B43.addEventListener (MouseEvent.Click, HandleEvent);
B44.addEventListener (MouseEvent.Click, HandleEvent);
B45.addEventListener (MouseEvent.Click, HandleEvent);
B46.addEventListener (MouseEvent.Click, HandleEvent);
B47.addEventListener (MouseEvent.Click, HandleEvent);
B48.addEventListener (MouseEvent.Click, HandleEvent);
B49.addEventListener (MouseEvent.Click, HandleEvent);
B50.addEventListener (MouseEvent.Click, HandleEvent);
B51.addEventListener (MouseEvent.Click, HandleEvent);
B52.addEventListener (MouseEvent.Click, HandleEvent);
B53.addEventListener (MouseEvent.Click, HandleEvent);
}
public void handleEvent (e: MouseEvent): void
{
var a: String = e.target.name;
Alert.Show (e.Target.Name);
var b:String = null;
Switch (a)
{
case 'Button20 ':
b = TextBox.Text;
TextBox.Text = "a";
TextBox.Text = b + "a";
break;
case 'Button21 ':
TextBox.Text = "b";
TextBox.Text = b + "b";
break;
by default:
TextBox.Text = "s";
TextBox.Text = b + "s";
}
}
[]] >
< / fx:Script >
< s:Panel = "43" x y = "82" width = "527" height = "213" >
< mx:Button = "71" x y = '86' id = "b1" label = "1" width = "30" height = "24" / >
< s:Button = "180" x y = '86' id = "b2" label = "5" width = "30" height = "24" / >
< s:Button = "127" x y = '86' id = "b3" label = "3" width = "30" height = "24" / >
< s:Button = "99" x y = '86' id = "b4" label = "2" width = "30" height = "24" / >
< s:Button = "323" x y = '86' id = "b5" label = "0" width = "30" height = "24" / >
< s:Button = "294" x y = '86' id = "b6" label = "9" width = "30" height = "24" / >
< s:Button = "265" x y = '86' id = "b7" label = "8" width = "30" height = "24" / >
< s:Button x = '237' y = '86' id = "b8" label = "7" width = "30" height = "24" / >
< s:Button = '209' x y = '86' id = "b9" label = "6" width = "30" height = "24" / >
< s:Button = "42" x y = '86' id = "b10" label = "" ' "width ="30"height ="24"/ >"
< s:Button x = "382" y = '86' id = "b11" label = "=" width = "30" height = "24" / >
< s:Button = '353' x y = '86' id = "b12" label = "» largeur" width = "30" height = "24" / > "
< s:Button = "410" x y = '86' id = "b13" label = "back" width = "76" height = "24" / >
< s:Button = "157" x y = '86' id = "b14" label = "4" width = "30" height = "24" / >
< s:Button = "43" x = "109" id = "b15" label = "tab" width = "66" height = "24" / >
< s:Button = "105" x = "109" id = "b16" label = "q" width = "31" height = "24" / >
< s:Button = "247" x = "109" id = "b17" label = "y" width = "30" height = "24" / >
< s:Button '303' = x y = "109" id = "b18" label = "i" width = "31" height = "24" / >
< s:Button = "361" x y = '110' id = "b19" label = "p" width = "34" height = "23" / >
< s:Button = "394" x = "109" id = "b20" label = "[" width = "31" height = "24" / >] "
< s:Button = "191" x = "109" id = "b21" label = "r" width = "34" height = "24" / >
< s:Button '424' = x y = "109" id = "b22" label = "]" width = "31" height = "24" / > "
< s:Button = "222" x = "109" id = "b23" label = "t" width = "31" height = "24" / >
< s:Button = "161" x = "109" id = "b24" label = "e" width = "31" height = "24" / >
< s:Button = "133" x = "109" id = "b25" label = "w" width = "31" height = "24" / >
< s:Button = "332" x = "109" id = "b26" label = "o" width = "31" height = "24" / >
< s:Button = "275" x = "109" id = "b27" label = "u" width = "31" height = "24" / >
< s:Button = "220" x = "133" id = "b28" label = "g" width = "31" height = "24" / >
< s:Button '424' = x y = "132" id = "b29" label = "enter" width = "62" height = "24" / >
< s:Button = "43" x = "132" id = "b30" label = "caps" width = "66" height = "24" / >
< s:Button = "275" x = "133" id = "b31" label = "j" width = "42" height = "23" / >
< s:Button = "314" x = "132" id = "b32" label = "k" width = "31" height = "24" / >
< s:Button = "133" x = "133" id = "b33" label = "s" width = "31" height = "23" / >
< s:Button = "161" x = "133" id = "b34" label = "d" width = "31" height = "23" / >
< s:Button = "250" x = "133" id = "b35" label = "h" width = "31" height = "23" / >
< s:Button = "105" x = "133" id = "b36" label = "a" width = "31" height = "23" / >
< s:Button = "191" x = "133" id = "b37" label = "f" width = "31" height = "23" / >
< s:Button = "342" x = "132" id = "b38" label = "l" width = "31" height = "24" / >
< s:Button = "152" x = "154" id = "b39" label = "x" width = "31" height = "24" / >
< s:Button = "353" x = "154" id = "b40" label = "'." " Width = "31" height = "24" / >
< s:Button = "325" x y = "154" id = "b41" label = "," width = "31" height = "24" / >
< s:Button = "294" x = "154" id = "b42" label = "m" width = "31" height = "24" / >
< s:Button = "259" x = "154" id = "b43" label = "n" width = "37" height = "24" / >
< s:Button = '236' x y = "154" id = "b44" label = "b" width = "31" height = "24" / >
< s:Button = "211" x = "154" id = "b45" label = "v" width = "31" height = "24" / >
< s:Button = "181" x = "154" id = "b46" label = "c" width = "31" height = "24" / >
< s:Button = "122" x = "154" id = "b47" label = "z" width = "31" height = "24" / >
< s:Button = "380" x = "154" id = "b48" label = "/" width = "31" height = "24" / >
< s:Button '368' = x y = "132" id = "b49" label width = ';' = "31" height = "24" / >
< s:Button = "396" x = "132" id = "b50" label = "" ' "width ="31"height ="24"/ >"
< s:Button = "43" x = "154" id = "b51" label = "shift" width = "82" height = "24" / >
< s:Button '407' = x y = id = "154" "b52" label = "shift" width = "79" height = "24" / >
< s:Button = "455" x = "109" id = "b53" label = "------" width = "31" height = "24" / >< / s:Panel >
< s:TextInput = "161" x = "27" id = "textbox" width = "253" / >< / s:Application >
Kind regards
Saran r
Hello
http://gumbo.flashhub.NET/keyboard/
It is a small example of a 'virtual' keyboard that will enter the text into a textinput/textarea component selected. Capslock and shift key States really aren't quite right (really need control shift/cap lock combo), but there is a simple tab and backspace (delete) and enter the function key.
hope this is useful
David.
-
How to make a slideshow of heroes with the text and the button for each slide?
I'm trying to make a basic slide show (auto no buttons) which will be the width of page 100% and I want each picture to have a title and a status button they can click to access other pages, for the life of me I can't this is! What I am doing wrong?
Indeed I could solve my problem, yay 2 + hours of troubleshooting finally paid off!
I tried the white color text and read 'Check this video now!', but the background was a color of the light, so it is in contradiction with the white text. To remedy this problem, I created a rectangle shape, he made black and reduced the opacity to 40% and threw it behind the text. In order to get the button under the text that says: 'Click here'! I was able to use a copy + paste glitch by sticking the trio in the caption text box for an image, thus allowing me to have a unique caption for each photo in an automatic slideshow. The problem arises due to the notion of a chart of the icon to stay on the text no matter how it is pasted into the text box but I could understand that if you group the text above the rectangle elements before pasting in the text area of the legend, then the text will remain on the chart! Yay problem solved (at least for now)!
-
How to paste into the text field of the Clipboard with JavaScript?
I implement the following actions in the form of javascript:
1. a user clicks on a link on the PDF to open a web page
2. the user uses the web page to find information and then copy text from the web page
3. the user clicks a button on the pdf form and it formats the text to the Clipboard and paste them into the text fields.
I can't find any references for the reading of the data from the Clipboard with javascript in PDF Forms. is it not possible?
Perhaps 'not possible' was a little too hard. It would be a security hole if she accepts a script in a form to copy the contents of the Clipboard without the user explicitly allowing it. It has been possible to copy the contents of the Clipboard into a form field using the app.execMenuItem method without the user knowing / allowing it, but that hole was closed. The restriction can be overcome, as explained in the documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.143.html
-
ODI can load data into the planning and REPLACE the existing data?
Hello
ODI (9.3.1.1) can load data into the planning and REPLACE the existing data?
Currently of our ODI by "ADD" load to existing data data - so that is I accidentally run the load twice, it would be double planning numbers. I don't know how to do it to REPLACE so that running more than twice has no effect.With the help of the essbase adapter you would use a rule of load, in the State of charge, you can set whether to replace or add to existing values. It is not difficult to pass.
See you soon
John
http://John-Goodwin.blogspot.com/ -
Firefox bookmarks bar does not allow me to drag-and - drop Web site icons. I went into the display and click on "bookmarks bar". bookmarks bar but her but its not allowing me to drag and drop the icon on the toolbar. I tried everything it is supposed to do, but his does not work. his frustration.
Stef. /. \
Make sure the toolbars like the toolbar 'Navigation' and the 'personal bar' are visible.
- View > toolbars
- Right click on empty toolbar space
Use the toolbar (Customize) to open the Customize and set the toolbar to display items.
- Make sure the "bookmarks toolbar items" are on the personal bar
- If "Bookmarks Toolbar items" is not on the bookmarks toolbar, then FRY it in the palette of the toolbar in the window the bookmarks toolbar Customize
- If the missing elements are in the toolbar palette then drag them from the window, customize the toolbar
- If you do not see an item on a toolbar in the toolbar palette and then click the button "Restore default" to restore the default toolbar configuration
- https://support.Mozilla.org/KB/how+to+customize+the+toolbar
- https://support.Mozilla.org/KB/back+and+forward+or+other+toolbar+items+are+missing
You can check the problems caused by a corrupt localstore.rdf file if the above didn't help.
-
I started meeting with eyestrain from prolonged use of the computer. Of course, I must simply reduce screen time, but may not reduce significantly again. During this time, I set it on a few minor visual adjustments that might be more favorable to the eye to me. A change would be to increase the size of the text and folder icons in my field of Windows Explorer. I tried to achieve this expansion by increasing my overall screen resolution, but that change has become cumbersome and actually greater stress perspective. Is it possible that I can change the size of text and icon from the Windows Explorer, without giving up its current location (details) and without affecting the size of anything else (for example, my office)?
I know that my investigation is not in the urgent category, but I would be grateful for all the advice. (Well, almost everything...?)
Thank you now also.
-BJJ
No do not trust them - it's a widespread scam underway. They want to ask you to install support software (usually decent software, like Team Viewer, that legitimate companies use to provide assistance), but then they use it to implant viruses. Or, more often, they open an arbitrary log file, claim this means that you have a virus, and they will help you conveniently 'fix' for a fair cost.
No one will ever 'cold call' offer to help you with your PC.
-
When I type text in my mobile e-mail, word, Excel etc the cursor goes up or down or in the middle of the text and delete the texts. some time remove all the texts. I'm fed up with it. How to solve it? Can someone help me?
I use vipre antivirus software. But after deep analysis it shows no any malware or spy ware seen.
Help, please...
Original title: malware or Trojan horse?
Cover the touchpad with a piece of cardboard, the next time you use * as you type something long *...
What do have?
-
Acrobat Standard DC - can't change the text and text box properties
Earlier this week, I lost the ability to change the properties of the text and text boxes.
When I add a comment with a text box or in the text caption, I do all the time, I used to be able to change the font color, size, alignment, etc.
Now, when I go to insert a text box or the legend, all the options in the properties bar are grayed out.
This issue effects ONLY the text in the box and the caption functions. all the other drawing functions work very well. I can change the color, fill and the type of lines around the text, I can just change the text.
Any suggestions?
Thank you.
Hello
We have released an update today which solves the problem of the properties toolbar and now you can continue to use it outside of the app commenting as well. Please open Acrobat or Reader DC and visit help > check for updates to ensure that you are on the latest patch.
Details on the release: https://helpx.adobe.com/acrobat/release-note/acrobat-dc-august-02-2016.html
Please let us know how it goes.
Thank you
-ashu
Maybe you are looking for
-
M2 - fixing external keyboard keyboard problem does not work either
Hello I have a user with a M2 Tecra keyboard works properly, 2 or 3 keys (Enter, space, lock), the rest of them when press cause a very quiet "beep" of the noise coming from the laptop. I guess this keyboard was defective - I have attached a usb keyb
-
How can I GET PGA APP TO STOP the MONTHLY FEE?
PGA APP CHARGES MONTHLY FEES. I CAN'T FIND A WAY TO STOP THIS. ??????
-
Dialog box retains the entries
Hello world I created a box of script and dialogue for the people in my office to use. I intend for people to take what I've created and save it to their computer this way with the master copy never gets dirty. In this dialog box, the user must enter
-
How to read the txt file that has words in between?
Hi all I'm using Labview 8.2. I would like to read a text file. I have given (after whenever he was on average more than 100 waveforms) several times recorded on the file. The idea is to further improve the SNR in post processing by averaging once
-
Return blackBerry Z10 z10 bringing BIS possible?
Hey all, now, I searched all over the internet to find a method to get BIS to work once again under the name of old devices but unfortunately his party! its is really disappointing. My question: is it possible to get him back by the software update