How to extract a string from a varchar column value
HelloI have a varchar2 column that got the xml data. I want to extract the value of a tag < test > < / test >
I can't use EXTRACT because the column is not XMLTYPE.
Please suggest.
Insert first only the first two columns:
INSERT INTO TESTXML (id,name) VALUES(1, 'ABCDEFTEST ');
INSERT INTO TESTXML (id,name) VALUES(2, 'XYZUVWTEST ');
INSERT INTO TESTXML (id,name) VALUES(2, 'XYZUVWTES ');
Make this update:
update testxml set temp=rtrim(ltrim(regexp_substr(name,'(.*?) '),''),' ');
Edited by: hartmutm the 01.10.2010 05:13
Tags: Database
Similar Questions
-
How to extract a string from a TextRange
Dear Experts,
How can I retrieve the string "=? UTF - 8? B? LDvGhsLCBGcmybYk? ="between the markers of coding?
Currently, I am able with the help of code as
\starttext = activeDoc.Find (startText.beg, findParams);
to find the exact begins and demand an end to the chain and I created the Base64TextTextRange.
With the statement activeDoc.TextSelection = Base64Text; I can highlight the text in my document.
I tried further with
Base64Item = activeDoc.GetTextForRange(Base64Text,Constants.FTI_String);
Base64String = Base64Item.toString ();
But still, I am not able to see the string in the object of the Toolbox browser.
Note that I do not use the GetText method because the string is only part of the paragraph.
Thanks for the tips.
The GetText method, you get an array of text elements. You need to assemble the parts of the string of the text element of individual objects in a single string, then fing encoding markers. Assuming that your Base64Text is a range of valid text, your code should look like this:
var saTextItems = activeDoc.GetTextForRange (Base64Text, Constants.FTI_String);
var i;
var sFullText = ";
for (i = 0; i< satextitems.length;="" i++="">
sFullText += saTextItems [i] .sdata;
var iPos1 = sFullText.indexOf ("=?") + 2 ; / * assuming =? is the beginning marker and adding 2 to point to the first position behind it * /.
var iPos2 = sFullText.indexOf ('? ') =", iPos1); / * Add the start shifted for good measure, but that may not be required here * /.
var sBase64String = sFullText.substring (iPos1, iPos2);
Alert (sBase64String);
I would like to know if it works for you. And mark the answer as correct if it does.
-
Greetings HP Forum,
Recently, I replaced a bad hard drive on my laptop. I need now step by step procedure to extract usable data from the wrong drive using 22 pins adapter usb to SATA on the new HD.
NOTE: I can't not all data that especially if some of the software downloaded on the replaced disk can be altered. Should I first download Internet Antivirus to protect my new hard drive? I'm not an expert, or even close to this when you work on the back of the laptop, so I'll have to step by step how to download and to partition the data recoverable and software, etc..
Thanks in advance for your help... I greatly appreciate it!
See you soon!
Wes
It is not complex. Attach the drive to the adapter and connect it to any other computer with good antivirus and antispyware installed. I use Malwarebytes and Avast. When you connect the adapter with the drive connected to the usb port, the drive will appear and it will be assigned a letter maybe E:\ or F:\ or something else. Immediately, he analyzes with the antivirus and anti-spyware. Quarantine or delete any virus or malware it finds. Then, it's just a matter of navigate the disk and copy and paste the contents of the host computer in a directory for this purpose. Obviously, you can copy from documents word, photos, music files, but you cannot copy the applications like Microsoft Word, iTunes. Photoshop. You may need to take ownership of the files on the old hard drive, but Windows will guide you through this. Don't know what else I can answer.
-
How to extract specific data from a text file
Hello world
For my project, it is necessary that a parameter file is read at the beginning, so that variables be initialized with specific values that change with the user.
For now, the mode of action is as follows: the values in a sequence specified in a text file are read and saved in a table and the elements of the array are extracted according to their index.
The problem with this implementation is, that if for any reason any changes file format, for example we want to use a settings file from a previous version of the program, which has the values for the variables of same but in a different order, the only way to have good values for the parameters is to change everything accordingly which is really time wasting.
Could someone suggest another implementation that make reading the different values independently of their order in the file, for example by analysing the file for specific strings and by reading the value after the string?
Thank you very much.
P.S. I've attached a screenshot of the routine, which I use now.
Hi panagiov,
Find attached files.
Method 1: in this you can search for each variable separately. You can use "Live Config file" to get all the keys (variable) at a time, and then you can use for loop to get their values. Or you can access values as indicated in the present code.
Method 2: Here you will have all the data at once. You will get variables and data (table 2D), you should look for the variables as needed.
I hope you understand these methods.
Good luck
-
Extract the string from the string
Hello guys,.
I have a small question. I would like to extract a string to another string. Imagine the following string:
param1 = value1 param2 = value2, param3 = value3, param4 = value4
I would like to be able to extract value2 and value3 to this string. I know that the design of the db is not perfect and should be like this. but it is historical and I have to use this way. Any suggestion?
Thank you
to retrieve param2
Select
substr (s
, instr (s, '=', 1, 2) + 1
, instr (s, ',', 1, 2) - instr (s, '=', 1, 2) - 1
) r
from (select "param1 = value1 param2 = value2, param3 = value3, param4 = value4's double)
or
Select regexp_substr (your_string, "[^,] +' 1, 4") from your_table
for example
Select regexp_substr ("param1 = value1 param2 = value2, param3 = value3, param4 = value4 ',' [^,] +' 1, 4") param2 double
PARAM2
'value2 '.
Post edited by: chris227
Corrected solution substr (sorry was before the first coffee ;-)) -
Extract the string from the chain - separator = ' | '?
Hi people!
I want to know how to extract the a string with delimiter = XE field ' |'.
For example:
String = "field1 |" Field2 |... | fieldX |... | filedn | »
I want to extract fieldX.
Thanks for your help, regards.Use the functions like this substr and instr
substr(string, instr( string,'|', 1, xth_occurrence)+1, instr( string,'|', 1,xth_occurrence+1) - instr(string,'|', 1, xth_occurrence))
Luca
Please, mark the reply as useful/correct if it is
Published by: Luka on January 26, 2010 10:42
Published by: Luka on January 26, 2010 10:42
-
How to extract the files from the HARD drive?
I have a HDD1805 from a broken iPod 80 GB. I was wondering if there was another method I could use to extract the files from the hard drive.
Hello
Sorry, but I don t know what you mean exactly.
Can you please explain exactly what you mean?What files you want to extract?
Good bye
-
How to extract the signal from the waveform of my power level designated?
Hi all
How can I extract the signal of the waveform accroding to the power level? I read the Trigger & Gate .vi, but this vi retrieves the signal duration. I want to extract the signal depending on the power level.
As shown in the following figures, the signal I want to deal with is between 130000 to 140000, if I Zoom, I can see the useful signal is between 135400 to 138200. The question is how to extract the signal in the area?
I tried the sub_NoiseEst_And_Chop_Shell.vi in the example of Packet_based_link also, but this Subvi seems to be a bit slow. Can someone give me the best advice? Thanks in advance!
I'm working on something similar, but have not had time to fully develop.
My idea was to use an envelope detector (low pass filter) and then use a detection of energy VI on the envelope.
Here is where I left
-
Hello
Please suggest me how to extract the file 'TTF' to a 'HAVE 'file with the help of the adobe Illustrator?
Thank you
Ankit Chugh
988885156
Ankit,
"" "" "" but now let's look at the other face, assuming that we do not have the fonts in our machine and we will always look for file HAVE, so we have to buy these fonts, am I right on this point, I want to just be confirmed in this regard.? "" » »
Yes, this is the case.
You can use the file HAVE to is to establish the names of the fonts, as it appears in I like you did as shown in your #10 post, so you can buy (or just download them if they are free fonts).
-
I know that I did it in before CVI...
Only, I don't remember how I did it...
(braindead today?!?)
Here goes:
Take a string:
"Mary had a little lamb".
FindPattern "little."
resulting string: "" Mary had a lamb.
What I have works to find the model and it is place.
-sigh-
I know I'll get because from what I remember, this is a very simple solution... I can't just think of him...
And I vaguely remember the name of the function that I used...
R
You could try something like this:
-
How to extract the string values
Hello
Database: 11.2.0.3.0
I have a JSON string like below. I want to extract only the propetyvalues. Can you help me with the query:
{
'documents':]
{
'document':]
{
'propertyname': 'Id',
'propertyvalue': "{1C236CB2-AB97-4982-8117-DE0BE6D7DB46}".
}
]
},
{
'document':]
{
'propertyname': 'Id',
'propertyvalue': "{1318AC90-C321-4D3D-9558-6547EFE49A7E}".
}
]
}
]
}
Hello
Too bad, that you do not have version 12. Then, you can use the function JSON_VALUE mentioned previously.
Here's something you can do in your version:
SELECT LEVEL AS n
, REGEXP_SUBSTR (: str)
, ' "propertyvalue": "([^"]*) "
1
LEVEL
NULL
1
) AS propertyvalue
OF the double
CONNECT BY LEVEL<= regexp_count="" (:str,="">=>
;
If you want to know that adapts to your specific problem, post CREATE TABLE and INSERT statements for some sample data and the exact results you want from these sample data.
-
How to extract a string required values?
Hello
I need to extract a particular to a string value,
for example:
entry:
abc def def test | test2 | test3
My required output should be:
Test | test2 | test3
How to go about this using any function or any other alternative.
Kindly advice!
OK, so we probably need to use a regular expression then. Something like this maybe:
Search: ^ [^] *? [^ ]*? [^ ]*? (.*)$
Replace: \1
It worked for me:
#reReplaceNoCase (Votrechaine, ' ^ [^] * []] *---* (.) ") *) $», « \1")#
#reReplaceNoCase (Votrechaine, ' ^ [^] * []] *---* (.) ") *) $», « \1")#
-
How to extract a string?
Hello, I have this string and I need to extract the 4 parts (in bold) of the chain, my string is:
"Dear (invoice): tom cruise you buy * 408 * of MENA.CA @ * 6.93* 10/01/09 watheeqa'"
What is the best technique to do this?
Thank youSomething like that?
with t as ( select '(invoice) dear client : tom cruise you Buy 408 from MENA.CA @ 6.93 01/10/09 watheeqa' data from dual) select regexp_replace(data,'^.* you (Buy|Sell)(.*) from (.*) @ (.*)','\1') buy_sell, regexp_replace(data,'^.* you (Buy|Sell)(.*) from (.*) @ (.*)','\2') amount, regexp_replace(data,'^.* you (Buy|Sell)(.*) from (.*) @ (.*)','\3') company, regexp_replace(data,'^.* you (Buy|Sell)(.*) from (.*) @ ([0-9]*\.[0-9]*) .*','\4') price from t;
Result:
1 rows selected BUY_SELL AMOUNT COMPANY PRICE -------- ------ ------- ----- Buy 408 MENA.CA 6.93 1 rows selected
-
How to extract the text from corrupted pages file
Really appreciate if someone of you knows a way to extract text from a page files of 9 MB that contains text and images and which does not:
Error message: file format not valid.
Change the type of file and opening in various programs (Word, Acrobat, Google doc converter) but nothing I've tried will open it.
I have a backup at home, but am away for several weeks and done a lot of work on this file since the last backup.
I hope there is a solution! Thank you
JR
If it is in fact a v5 Pages document, and it will not open in preview, or open in v5 Pages while holding the SHIFT key, then you're done. The inner content in Pages v5 is in a format that is illegible, indecipherable, scrambled anything able to read except Pages v5.
If it's a v5.5.2 Pages or a later version of the document, then it is by default in a single file format (file zip compressed/renamed), and no version of Pages thru v5.2.2 on Mavericks v5 was designed to play a single file format documents that are not original Pages ' 09. If it is a document Pages from Yosemite or El Capitan, you will need the v5.5.3 Pages or later to change the type of file to the package format - which can be read by v5 + Pages on the Mavericks.
If it is a Pages ' 09 document, there is a good possibility that your attempt to open/edit/etc this document with all of the people mentioned applications has damaged the document permanently. Try the preview or the free LibreOffice (v5 or later) which can open documents file format only (not the package files) of Pages ' 09 very simple, sometimes with pictures. No warranty if.
-
How to extract zipped files from external hard drive?
I saved the content of my HP laptop, the HD is made horrible noises of an external HD. How can I extract the files zipped to another HP laptop?
See this page
Maybe you are looking for
-
I bought the new iphone 6 s more and I have not configured, I just opened the phone and charged, but after some time it stop by itself, is this normal or I have a problem with my phone?
-
Unable to download photos from the camera
Because my PC repaired and deleted vruses, I don't get the normal box, «what do you do with...» "When you try to dowloan photos from my camera. Any thoughts? Also note that my Pc won't load discs either
-
print on paper legal landscape of Excel
I try to print a spreadsheet legal landscape. I enter all the correct options in excellent but the printing width always comes out only the width of the letter, the preview shows legal-size paper, but stops printing letter-size. How can I change th
-
BlackBerry Smartphones Can you activate and use "BOLD" on Verizon?
I have a storm and wishes to buy a "BOLD" If there is a way to activate and use all the features on Verizon. Is this possible or should I expect for the "BOLD" on Verizon?
-
How to organize emails exported from direct mail of the date of receipt
Am on Windows 7 with windows live mail and have exported e-mails to a storage folder. How to organize emails exported in the receive folder