Extraction of channel number
Hello
I have a T1 table as below:
Column_Name Remarks_column
Column1 data incompatibility. Source value 20. Target value 100
Incompatibility of Column2 data. Source 50. Target value 80
Data mismatch Column3. Source 273. Target value 527
I want to extract the numeric part of Remarks_column and perform operations on columns with the value of the target less than source value.
How can I extract my source and target numbers separately to compare?
Select
regexp_substr (Remarks_column, '\d+', 1, 1) source
, target regexp_substr (Remarks_column, '\d+', 1, 2)
from t1
It does not work on the boards and if there could be some decimal numbers. Only on whole positiv
(But could be extended easily ;-)
Post edited by: chris227 added note
Tags: Database
Similar Questions
-
Hello
I have a problem with a select.
I need to compare two string columns. First column includes only a number of 9 characters:
'001234567'
Second column includes the text where somewhere in this text is the number 001234567.
'Hallo1 001234567'
I need to extract the character number of 9 big off the chain. I thought by using regular expression could help me.
But it would exclude the number 1 after Hallo:SELECT REPLACE(REGEXP_REPLACE('hallo 001122334', '[a-z]', ''),' ') "REGEXP_REPLACE" FROM dual;
Result: '1001234567'
The number I get is always 9 characters long.
Thanks in advance,
TobiasSomething like that?
SELECT regexp_substr('hallo1 001122334', '[0-9]{9}') FROM dual;
-
Function to extract a phone number of an address?
Hello
I need to implement a function that is capable of extracts a U.S. / Canada phone number (in a variety of formats) from an address.
For example, I need to extract the telephone number of a string like:
Mr. A. Johnson
J & son Inc.
123 front st.
Tel.: 613-123-1234 ext.216
The function should return * (613) - 123-1234 *.
Any help will be greatly appreciated.
Kind regards
Mr. RusuSQL> select regexp_substr ( address , '[(]?' || -- 0 or 1 left brackets '[0-9]{3}' || -- 3 digits '[). -]*' || -- 0 or more separator characters '[0-9]{3}' || -- 3 digits '[. -]*' || -- 0 or more separator characters '[0-9]{4}' -- 4 digits ) as phone_number from ( select '123 456-7890 ext.216' address from dual union all select '(123) 456-7890 ext.216' address from dual ) / PHONE_NUMBER ---------------------- 123 456-7890 (123) 456-7890 2 rows selected.
-
Channel number (GroupIndexGet provided works that you know the name of Group) group
As it says in the title. Im trying to get the index number of the user's group after selecting a channel. The ChannelNameGet relies also on that you know the index of the group here, any help would be greatly appreciated!
Thank you very much
Dan
Hi Dan -.
If you are using a relatively recent version of DIAdem, simply use the Data Portal object-oriented structure:
Data.GetChannel ("Channel_Name"). ChannelGroup.Properties ("index"). Value
.. .or "Channel_Name" is the name of your channel. If you use above the line of code literally, then make sure your channel name is unique - otherwise you will need to provide a name to group (e.g. "strain/Channel_1") to the parameter passed to the GetChannel() method.
-
Extract single channel DAQmx task
Hello
I created a task DAQmx output, which contains two channels. Is it possible to extract the individual virtual channels of the task to be dealt with by two parallel processes? I tried to bring out the ownership of channels using a task property node, but then I get the error that the channel is not part of an active task (see excerpt)
Could someone advise on a better approach, or how to obtain this feature - if that's possible?
Concerning
Dave
Sorry, that VI does not have much sense. You must use a unique DAQmx writing for both channels and 1 sample mode, simply build an array of signals as shown below.
-
Hello
I'm writing analogues of the buffer to several channels using NOR-6723.
For some reason any, whenever I go to the buffer double function (1-d) that contains buffers for all channels.
I always find myself with exception indicating that the numbers of channels in the data are '1 '.
I use c#:
Task m_TaskHandle = new Task(); string sChannelsList = "Dev2/ao21:23"; m_TaskHandle.AOChannels.CreateVoltageChannel( sChannelsList, "", 0, 5, AOVoltageUnits.Volts ); int iNumberOfSamples = 4; double dSamplingFrequency = 1000; m_TaskHandle.Timing.ConfigureSampleClock("", dSamplingFrequency, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, iNumberOfSamples /* Only relevant if mode is FiniteSamples */); // Data code is heredouble[] adSampleBuffer;// array values removed from this code snippet (here i have function that generates data)// array size is: num_of_samples * total_channels (in this case 4 * 3) AnalogSingleChannelWriter ChanWriter = new AnalogSingleChannelWriter(m_TaskHandle.Stream); ChanWriter.WriteMultiSample(false, adSampleBuffer); m_TaskHandle.Start();
Not sure I'm I missing, how the MSTDIO determines the "number of data channels", I receive as an exception, it is always equal to 1.
would appricate to help.
Thank you.
Hi idanbis,
As the snippet you posted, you can create more than one channel using the ao21:23 range. That said, you should use AnalogMultiChannelWriter to configure your write instead of AnalogSingleChannelWriter operation.
To write using AnalogMultiChannelWriter::WriteMultiSample (boolean, double, you must know the data you want to write must be stored in a 2D array.) Each element in the first dimension of the array corresponds to a channel in the task, while each item in the second dimension, to a sample of write on its channel. For example, that:
Double [,] data = new double [numChannels, numSamplesPerChannel];
Then:
data [0, 0... numSamplesPerChannel]; It is the set of all samples in the first string (ao21 in your code).
I hope that was helpful. Let me know if I left any doubt remaining.
Best regards
Anzurio
-
Extract a channel of a digital waveform
I use the I2C Digital Waveform reference Libarary to create a WDT which consists of two lines/channels. I was wondering how I could extract/remove a channel, the wave form and how can I add/merge signals tracks in a single WDT? I looked around for the screws, but nothing seems to work with the WDT.
Right now my WDT is like this:
How can I get these two lines in separate WDTs? And then how would I be able to merge them again? Naturally, I don't want to just remove them and merge them, but that would be an example of good practice to demonstrate.
After much trial and frustration, I found a way to do what I was looking for. It is not the most elegant, but it works!
That's how I extracted the two strings in an array and then merge to recreate the original graph:
* Note: The reason why there are 2 in the waveform data table is because my waveform contains 0 and Z instead of 0 and 1. The three States Z corresponds to the 2 digital.
I even took it a little further and extract a single line. This could be changed to extract any line and eventually merge your own custom signals:
-
Channel number SELECT dataset not return
Hi, I have a problem with the following code:
PROCEDURE create_so (p_import_batch IN VARCHAR2) IS v_import_batch VARCHAR2(1000); CURSOR sales_c (x_import_batch IN VARCHAR2) IS SELECT pbo.* , msib.inventory_item_id FROM XXMEL_PVS_BSH_ORDER pbo , mtl_system_items_b msib WHERE 1=1 AND msib.segment1 = pbo.material AND msib.organization_id = 26 AND to_char(pbo.import_batch_id) IN ( x_import_batch); BEGIN select '('''||replace(p_import_batch,':',''',''')||''')' INTO v_import_batch from dual; FOR sales_r IN sales_c (v_import_batch) LOOP raise_application_error(-20001,v_import_batch);--Program should raise this error as the cursor should return rows END LOOP; END;
I'm passing in the procedure a 1:2:3 as a VARCHAR2 parameter. The value should be passed as a VARCHAR2 because we use a part of the shuttle from one page of the APEX.
I want to extract all records in the table of pbo which have an import_import_batch_id (which is a number data type) as v_import_batch who, at the minute ('1', ' 2', 3').
The import_batch_id is a numeric field, so I got to to_char to try to work with the VARCHAR2 parameter I am by the way.
The
select '('''||replace(p_import_batch,':',''',''')||''')' INTO v_import_batch from dual;
code works well and is back ('1 ', '2', 3') which is what I want. If I then run the select with this hard coded that value
SELECT pbo.* ,msib.inventory_item_id FROM XXMEL_PVS_BSH_ORDER pbo , mtl_system_items_b msib WHERE 1=1 AND msib.segment1 = pbo.material AND msib.organization_id = 26 AND to_char(pbo.import_batch_id) IN ('1','2','3')
It works OK and return lines that I expect returned. If I try to use the variable rather than the hard-coded value, the SELECT statement does not return anything.
Any advice would be great.
Thank you
Chris
You must convert your of as '1 ', '2',' 3' can be considered to be 3 ranks.
Try the following question
SELECT pbo.* ,msib.inventory_item_id FROM XXMEL_PVS_BSH_ORDER pbo , mtl_system_items_b msib WHERE 1=1 AND msib.segment1 = pbo.material AND msib.organization_id = 26 AND to_char(pbo.import_batch_id) IN ( select regexp_substr ( txt, '[^,]+', 1, level) data from (select '1,2,3' txt from dual) t CONNECT BY level <= length (txt) - length (replace (txt, ',')) + 1 )
-
most effective way to retrieve the channel number
Hello guys,.
I use this Regexp to extract numbers in a string, and I doubt that there is a more effective way to achieve this:
SELECT regexp_replace (regexp_replace ( REGEXp_REPLACE (' !@#$%^&*()_+= '' + 00 SDFKA 324 000 8702 234 | " ' , '[[:punct:]]',''), '[[:space:]]',''), '[[:alpha:]]','') FROM dual {code} Is there a more efficient way to get this done ? Regards, Fateh
Hello
Using regular expressions, you can remove everything that is not a number by saying:
REGEXP_REPLACE ( str , '[^[:digit]]' )
When ^ is the first character inside the brackets, it means "everything except the following.
-
extract an unknown number of particles of larger particles
Hello
I am the image processing stage and after a few steps, I get a black and white image with 1 or none of the particles of treatment. However, I like to define a default case if more than one particle. As the other particles are due to the noise their size will be reduced but still unknown. That's why I thought to extract areas of these particles by analysis of particles through a loop labview vi for, but I have no idea how select the particle with the largest surface area and determine its Center. Can anyone provide a solution for this?
Hello
How about doing something like this:
I used 'count the objects', but you can use any other function which is part of the Center area and purpose of the particles.
Best regards
K
-
read only channel number and the number
I have "COM4" of my I/O. How could read number 4 only?
Thank you
Like the picture as an attachment you can try 'n' in various ways
-
Extract a variable number of bits of byte array
Hello
I was working on the decoding of a binary file and one of the tasks is to extract data from a fixed-length U8 array variable bits. The image below is a simple illustration of this particular task.
Now, before you post you solution, I have already examined 2 methods of forum I searched so far, here is the following excerpt from a simple example of code.
So 2 of the U8 data array element, I extract the 3, 9, and 6 bits of the data in this table and place it in another table (for simplicity).
However, I believe that these 2 methods may not be effective in terms of speed and memory performance.
I would like to know if there is than other alternatives to solve this problem. If so, share with us.
Thank you.
Kind regards
NGO Lim Ee
I'm here with GerdW. If you have a set of data block (blocks of 8 or fewer), read like a U64 data and then make a few little shifting and masking with ANDS to recover your data.
But looking at your two methods, you can not remove it use the table since this is an expensive process. Instead, use the subset of table and keep track where you are in the table with an another shift register. Who would avoid some memory allocations and expedite method 2.
-
Regular expression - get longer channel number
I think it's easy, but I can't get it. Lets say I have a string "A1_1000", I would like to remove the 1000 using regular expressions. When I fed regular expression Match I get '1', which is not the longest number. I know other ways to do it, but I want to clean the solution in one step. Anyone know the regular expression to the right to achieve this? Thank you!
ceties wrote:
It is the best solution I've been able to come. I wonder if there are "more smooth way" without the cycle of.Since several checks are needed, I would tend to beieve we must travel opportunities. in this example
I start to check at '0' offset in the string to a number. Provided that I have find a number, I check if it is longer that any previous number, I found and if so, store the new number more in the shift register.
Have fun!
Ben
-
Hello experts.
I am trying to extract figures below these model;
with t as
(
Select ' 6-27-40-12 W4M "as req_id, 1 as the id of the double."
Union of all the
Select "FERRIER - 10-24-41-9 W5M" as req_id, double id 2
Union of all the
Select 'M.D. '. Dunvegan - W6M 30-80-3 DON'T ' like req_id, 3 as the id of the double
Union of all the
Select "BELLSHILL LAKE - 5-21-41-12 W4M" as req_id, 4 as the id of the double
Union of all the
Select "County of LATHOM - W4M SW 20/10/17" as req_id, 5 as the id of the double
)
Select * from t;
Required result
ID req_id
1 6-27-40-12
2 10-24-41-9
3 30-80-3
4 5-21-41-12
5 20/10/17
Hello
user13328581 wrote:
Thank you all
Just quick question, there has been a change in needs. How to get the following results below instead
with t as
(
Select ' 6-27-40-12 W4M "as req_id, 1 as the id of the double."
Union of all the
Select "FERRIER - 10-24-41-9 W5M" as req_id, double id 2
Union of all the
Select 'M.D. '. Dunvegan - W6M 30-80-3 DON'T ' like req_id, 3 as the id of the double
Union of all the
Select "BELLSHILL LAKE - 5-21-41-12 W4M" as req_id, 4 as the id of the double
Union of all the
Select "County of LATHOM - W4M SW 20/10/17" as req_id, 5 as the id of the double
)
Select * from t;
the result below is obtained from the ID that matches models
(1) 9-9-9-9-W9M
(II) 9-9-9 with SW/SE/NW/NO
Required result
ID req_id
1 6-27-40-12 W4M
2 10-24-41-9 W5M
4 5-21-41-12 W4M
20/10/17 5, W4M
Sorry, I don't understand what you're saying about "W9M." I don't see this substring anywhere in the sample data.
Also, I don't understand what you want with "So/SE/NW/DON'T. Explain what exactly are the requirements.
Why don't you want to
ID REQ_ID_SUBSTR
--- --------------------------
3 30-80-3 W6M
in the output?
The following query gives the results you requested and the line above:
SELECT id
REGEXP_SUBSTR (req_id,
, '\d+(-\d+)*\s+\S+'
) AS req_id_substr
T
ORDER BY id
;
To exclude the row with id = 3, you probably need a WHERE clause.
-
Get channel number after a character
Hi all
Can someone help please how to get a number after a specific symbol (' # ')?
For example to get the FIRST digit after the hash tag with empty space ("credit memos # 134062 - credit invoice in its entirety due to calculationRe 133758 incorrect charged car and van 130463Crew")
necessary result from above: 134062
Kind regards
Alex
SQL> with t 2 as 3 ( 4 select 'Credit Memos # 134062 - Crediting invoice 133758 in full due to incorrect calculationRe invoiced 130463Crew car and van ' str 5 from dual 6 ) 7 select regexp_substr(str, '#[[:space:][:digit:]]+') val 8 from t; VAL --------- # 134062 SQL>
Edit: Removed the vertical bar symbol (|). See Frank's response below. Go with this approach if you're on 11.1 and above.
Maybe you are looking for
-
How to recover permanently deleted photos iOS?
Recently, I accidentally deleted photos of my camera and later permanently erased from the recently deleted folder and forget they were there. I only have backups iCloud. I don't have any iTunes ones. I tried the deletion and restoration of two backu
-
I have a total of 11 mp3 files that I need to add to this photo film and I have 10 mp3 files already imported, but it won't let me add the last of them.
-
Original title: sleep problem My computer continues to stop rather than go to sleep even though I did change advanced power settings.
-
OK, so I FOOLISHLY accepted the version of office 7 update notification and downloaded and installed the new version, only to be reminded that I had done this before, had problems and had to downgrade. Months ago I had problems and spent hours of my
-
GANYMEDE + Config questions
3750 Ganymede SE4 IOS 15.0 (2) then the radius-server show host X.X.X.X I get "the cli will be deprecated soon" Please notify