Separation of the characters in a string
I have a string in which all characters are separated by a space. I want to extract each of these characters to different substrings. Is there a way to do this?
For example: a string of parent : 1 g 3: 00 p
need =>
channel 1: 1
Channel 2: a
Channel 3: g
Channel 4:3
Channel 5: h
Sun 6: p
Thank you.
I would use the spreadsheet String to Array with a space defined on the delimiter.
Tags: NI Software
Similar Questions
-
separate the characters in a string
Hello
Y at - it an easy way of seprerate characters in a string
For example if I have a string 'abcdef '.
I want to seprate it in an array of 7 elements, where each element is a character in the string.
Thank you
Hi reza_sed,
the attached picture shows one solution.
Mike
-
Get all the characters in a string of 2nd
Hello
Know you what is CF do I need to get each character 2nd a string? Basically, I have a string: w3f587j8a9. I want to get every 2nd, 4th, 6th, 8th, 10th, ect... So, the result would be 35789. Of course the loop limit will be as 4 characters or something like that.
Thank you.
Something like that you mean?
#newstr #. -
Changeparticular the characters of a string using regular expressions...
Hi all
I'm writing a function using the function of expression regular oracles REGEXP_REPLACE but I could not succeed until now.
My problem is as follows, I have a text in a column say "Scott Sdfdfs Sdfd" I want to replace all the s and S with X characters and make the text looks like "XdfXdf XdfdfX Xdfd".
It is possible by using regular expressions in oracle?
Can you give me some clue?
Thank youselect regexp_replace('sdfsdf Sdfdfs Sdfd', 's|S', 'X') Replaced from dual;
REPLACED ------------------ XdfXdf XdfdfX Xdfd
-
How to extract the characters of mixed string?
"I have a string like ' ORA123CLE * () ^ % ^ & NET + -* / WORK"
I need output like-> ORACLENETWORK
Hello Bharathoracle
SELECT REGEXP_REPLACE (' (ORA123CLE) * ^ % ^ & NET + -* / WORK ',' [^ [: alpha:]]', ") FROM DUAL;
Kind regards
David
-
To delete the characters only at the beginning of a string using regexp_replace
I want to be able to delete the characters in a string only until the first numeric value. If it takes place after the digital, I want to keep them.
"for example"AB1234' becomes '1234', 'AB1234C' becomes ' 1234 C.
It might be also spaces and other types of characters at the beginning. I tried this:
Select
regexp_replace ('ABC1234', ' [^ [: digit:]]').
regexp_replace ('AB 1234',' [^ [: digit:]]').
regexp_replace ('AB 01234',' [^ [: digit:]]').
regexp_replace ('AB1234C', ' [^ [: digit:]]').
regexp_replace ('^ 1234', ' [^ [: digit:]]').
regexp_replace ('* #1234Z ',' [^ [: digit:]]')
OF THE DOUBLE
For all except "AB 01234' returned '1234' so it retains the digital. For "AB 01234' it returns correctly '01234'
The bad are those with a character after digital, for example "AB1234C".
I know it I'm missing something here, can someone please help with this?
Thank you
SQL> with t 2 as 3 ( 4 select 'ABC1234' str from dual 5 union all 6 select 'AB 1234' str from dual 7 union all 8 select 'AB 01234' str from dual 9 union all 10 select 'AB1234C' str from dual 11 union all 12 select '^1234' str from dual 13 union all 14 select '*#1234Z' str from dual 15 ) 16 select str 17 , regexp_replace(str, '^[^[:digit:]]+') str_new 18 from t; STR STR_NEW -------- -------- ABC1234 1234 AB 1234 1234 AB 01234 01234 AB1234C 1234C ^1234 1234 *#1234Z 1234Z 6 rows selected.
-
How to remove the first few characters of a string of liquid
I would like to delete the first three characters of a string of liquid. The question is how.
If I use the markup according to liquid when I know what are the first characters
{{it. {{["Estate status'] | strip_html | remove_first:"11."}}
It will remove the 11 characters.
But if I don't know what are the first characters, this markup can I use to get "RID" of the first three characters?
I tried 'split' and 'slice', but it must always know what characters to split or slice.
Thanks for any help.
Kind regards
Carla
Assign a value into slices and you can have table data that you can get out.
-
Bunch of Oracle on the special characters in a string - translate?
How to remove special characters in a string, it can contain. , (space), etc.
SELECT TRANSLATE('123.456 (90-90)', '', '') FROM DUAL
Basically I want to undress and to compare with the db value.
WHERE TRANSLATE(TABLE.NUMCODE, '', '') = TRANSLATE('123.456 (90-90)', '', '')
Use TRANSLATE, since you're on 9i. For example:
TRANSLATE (your_string,'X,. #! % @$ ^ & * () _-+=', 'X')
Removes all the s characters in ', #! % @$ ^ & * () _-+=' of your_string.
SY.
-
work with strings, substring, pulling the characters after a certain word
Hello please see this string:
var String1:String = "we invite you to join our celebration of the world day of intellectual property 2015 brain where: 149 Swan St., Buffalo, NY 14203 handlebars when: Thursday, April 23, 2015, 05:30 - 19:30 there will be drink specials and complimentary hors d'oeuvres!" And prizes! ";
What I want to do is to remove all characters after the word ' where: ' in a string so that it hits "when:" & do the same thing to grab the string of the moment: until it hits PM
What is the best way to do it?
Thanks in advance.
String.indexOf allows you to find the position of a string in the main string, substr years or a substring out pieces. Something like this:
trace (string1. Substring (string1. IndexOf("WHERE:") + 6, String1.indexOf ('When :")));
trace (string1. Substring (string1. IndexOf("When:") + 5, String1.indexOf ("PM") + 2));
-
How to divide the characters in table 1 d
I am looking for a way to divide the 'print' to a string 1-d subarray. For example instead of:
1 / AAAABBBB
2 / CCCCDDDD
3 / EEEEFFFF
...
etc.
then there would be two tables 1 d separated where before there was a:
1 / AAAA and BBBB
2 / CCCC and Delalande
3 / EEEE and FFFF
...
etc.
Something like that?
You need better on where the split to take place? I doubt somehow you want just a simple divided into a constant place.
-
Remove 10 characters of this string
How to remove the last 10 characters of any string?
\
Keep throwing me these easier!
-
Is there a function to adjust the length of a string to 8 multiple bytes?
Hello
I have a function to encrypt a password.
FUNCTION encodeit (p_name IN VARCHAR2, p_password IN VARCHAR2) RETURN VARCHAR2 IS l_password VARCHAR2 (4000); l_salt VARCHAR2 (4000) := 'hdjikndbbhitasuihfnnkqyhiplwmneuyndnloidj'; BEGIN l_password := UTL_RAW.cast_to_raw ( DBMS_OBFUSCATION_TOOLKIT.md5 ( input_string => p_password || SUBSTR (l_salt, 10, 13)|| LOWER (p_name)|| SUBSTR (l_salt, 4, 10))); RETURN l_password; END;
I want to decrypt the password to send to users when they forget it. I wrote this function:
FUNCTION decodeit (p_name IN VARCHAR2, p_password in VARCHAR2) RETURN VARCHAR2 IS l_salt VARCHAR2 (4000) := 'hdjikndbbhitasuihfnnkqyhiplwmneuyndnloidj'; BEGIN RETURN DBMS_OBFUSCATION_TOOLKIT.desdecrypt(input_string => p_password || SUBSTR (l_salt, 10, 13)|| LOWER (p_name)|| SUBSTR (l_salt, 4, 10), key_string => l_salt) ; END;
The problem is that the DBMS_OBFUSCATION_TOOLKIT.desdecrypt function needs a multiple of the input string of 8 bytes. And p_name and p_password are not of fixed length. Is there a function to adjust the length of a string to 8 multiple bytes?
Best regards.
They used to work - could be almost ten years (I think version 9 - not tested yet)
As you can see, you can 'encode' the number of characters, padded in order to set the right length of the decrypted string
create or replace FUNCTION ' CRYPTIN "(p_str in varchar2) return varchar2 as". "
l_data VARCHAR2 (255);
function pad_DES (p_string in varchar2) return varchar2 is
-platelets p_string with pad_chr containing the number of characters padded (1 to 8)
-make the string length a multiple of 8 as required by decipher
pad_length pls_integer;
pad_char char: = chr (0);
pad_chars varchar2 (8);
Start
pad_length: = 8 - mod (length (p_string), 8);
pad_chars: = chr (pad_length);
Return concat (p_string, rpad (pad_chars, pad_length, pad_chars));
end;
Start
l_data: = pad_DES (p_str);
dbms_obfuscation_toolkit. Decrypt (input_string-online l_data, key_string => 'MagicKey' encrypted_string-online l_data);
return UTL_RAW. CAST_TO_RAW (l_data);
end;
create or replace FUNCTION ' CRYPTOUT "(p_str in varchar2) return varchar2 as". "
l_data VARCHAR2 (255);
function unpad_DES (p_string in varchar2) return varchar2 is
-Removes from p_string upholstered characters (1 to 8)
pad_length pls_integer;
Start
pad_length: = length (p_string);
pad_length: = pad_length - ascii (substr(p_string,pad_length,1));
Return substr(p_string,1,pad_length);
end;
Start
l_data: = p_str;
dbms_obfuscation_toolkit. DESDecrypt (input_string-online l_data, key_string => 'MagicKey', decrypted_string-online l_data);
Return unpad_DES (l_data);
end;
Concerning
Etbin
-
Advice on the use of APEX_JSON with a CLOB in the body as a string
Hello all and thanks for any help in advance.
I have the task of liaising with a 3rd party API via JSON to send information to our database. First warning is the HOST for us is not and race so I have no way of properly this test until tomorrow, but I wanted to ask this question to try to overcome a potential problem.
In the body of the JSON object, we must add a chunk of xml (already created/kept or can be created on the fly) and it must be validated on as a long string. Now, this question is that the string can be up to 20000 characters long so when its processed is stored as a CLOB in the database (not made by me).
Now my thoughts early to do this was to create a procedure allowing certain parameters get the relevant piece of data and xml stored as a CLOB. Then and that's where I maybe need some tips, follow these steps.
This host requires JSON in this format
{
'batchcode': 1234562,
'XML string': 'THIS WILL BE a MASSIVE XML STRING',
""bounding ":" ",".
"ID": "123456465",
'field1 ':
.
.
etc.
}
We currently have a few apex applications so I got a good look at the documentation and allows to generate the required using JSON:
Thus to collect information of input parameters
APEX_JSON. INITIALIZE_CLOB_OUTPUT;
APEX_JSON. OPEN_OBJECT();
APEX_JSON. WRITE ("batchcode," value from database");
APEX_JSON. WRITE ("XML string ', our xml database that is stored as a CLOB string");
APEX_JSON. WRITE (bounding "," value of database");
APEX_JSON. WRITE ('ID', 'Value of database');
.
.
.
etc.
APEX_JSON. CLOSE_OBJECT();
Then validate using endpoint:
APEX_WEB_SERVICE. () MAKE_REST_REQUEST
p_url = > 'URL of the end point. "
p_http_method = > 'MESSAGE ',.
p_username = > API_USER,
p_password = > API_KEY,.
p_body = > apex_json.get_clob_output
);
Now assuming that my method is correct only the APEX_JSON. WRITING literally accept its entry as a type CLOB and he will be able to properly analyze or will it arrive at a mansion that will actually write the string itself?
Edit I found that if I APEX_JSON. WRITE ("XML", "CLOB table column") that it exported the CLOB but not in the format I want. This is due to the fact that my CLOB has characters like <>etc in II and the output is burning out in unicode, so for example <? XML version = "1.0" encoding = "UTF-8"? "> as stored in the object CLOB becomes \u003C?xml version=\"1.0\ ' encoding =------"UTF - 8\ '? \u003E\n in the output using APEX_JSON. To write.
The only other way to do it, I think it is so divided in pieces as follows:
SELECT ROWNUM as XML_PIECE_NO, TO_CHAR (SUBSTR (a.xmldoc, (ROWNUM-1) * 4000, 4000)) AS SECTION
Of ast_xmldata one
CONNECT (ROWNUM-1) * 4000 < = LENGTH (a.xmldoc)
Then maybe concat in the JSON long xml string field.
I hope I have explained what I want to do but if not please respond any help will be greatly appreciated.
Concerning
Post edited by: K4E
EDIT I CAME FROM WITH a SOLUTION
Post edited by: K4E - found solution 02/04/2016
Thanks for the response of Christian, logical exit that way.
Through some trial and error, I found a solution to my problem that seems effective enough without having to worry about unicode characters written. There is seemingly a procedure without papers in the APEX_JSON package called apex_json.write_raw that does what it says. All I had to do then was to use escape characters in my CLOB for things like "then I get a few good valid JSON in the format of the API, I work with love."
Hope this helps someone else with the situation.
K4E
-
Formula to replace characters in a string
Hi all
Is it possible to replace characters in a string somewhere if the string has no specific pattern for these characters? I use the replacestr function to replace characters in a string (i.e. ABC), but the chain is in the ABC format * where * are two random characters. The result I'm looking for is to replace ABC * with the NodeID.
ReplaceStr (propvalue (Core.Abbrev), ABC, ID (), T),) This formula works, but is either two additional characters in the end, after ABC. How can I cut that?
Thank you
If)
Not (Equals (Integer, length (PropValue (Core.ABBREV)), length (ReplaceStr (PropValue (Core.ABBREV), ABC, T))),
ReplaceStr (PropValue (Core.Abbrev), PropValue (Core.Abbrev), ID (), T),
PropValue (Core.Abbrev)
)
-
get the length of each string in a column
Hi all
Is there a way to get the length of each string in a column:
for example:
If the table contains lines like below:
Select 'test test1 test31' col1 of double
Union of all the
Select 'sectest1 sectest234' double col1
The output should be as below:
col1
------------
4 5 6
8 10
That is to say get the count of each separated from the chain of space in a column. Is this possible using regexpr_substr?
Thanks in advance.
Roy.
Try the below
SELECT LISTAGG(val1,' ') IN ONE GROUP)
New_val ORDER BY lvl)
Of
(SELECT LENGTH (REGEXP_SUBSTR (col1,'[^] +', 1, LEVEL)) val1,)
RN,
LEVEL lvl
Of
(SELECT col1,
ROWNUM rn
Of
(SELECT 'test test1 test31' col1 OF double)
UNION ALL
SELECT 'sectest1 sectest234' double col1
)
)
CONNECT BY LEVEL<= regexp_count(col1,'="">=>
AND PRIOR rn = rn
AND PRIOR DBMS_RANDOM. VALUE IS NOT NULL
)
GROUP BY rn;
OUTPUT:-
=======
col1
----
4 5 6
8 10
Thank you
Ann
Maybe you are looking for
-
kernel_task takes too much memory on El Capitan
Hello, I own a MacBook Pro retina 13 inches beginning 2013 (MacBook Pro 10.2) with 8 GB RAM and El Capitan 10.11.6. I noticed that I have a process in my activity monitor called kernel_task who gets in as 750 MB of my memory, sometimes of 1 GB. It's
-
I was at my friends house and could easily share pictures using drop from his iPhone to my iPad. But when I wanted to share pictures with my iPhone and iPad at home, users do not appear on the two Apple devices. Any help please? Post edited by: Matt
-
Hello HP community! I was wondering how... I heard that people are able to upgrade their quad Envy 17 with SSD 250 GB in addition to store 1 TB of HARD drive. Are there difficulties to face? I just bought Samsung 840 EVO KIT (250GB). Any recommendati
-
Flashing that says automatic processing.
There is a box in the middle of the screen that flashes. It says automatic processing. I don't know what it is or how to make it go away. Help, please! Michelle
-
Computer laptop dv5 off suddenly when the battery charge reaches46%
First of all, thank you in advance for any help possible. Of heres my portable computer Spec Intel (r) Core (TM) 2 Duo CPU P8400 2.26 GHz 2.27 GHz 3.00 GB RAM Windows Vista. Problem: Well my laptop around 1 year and something weird started happening