divide the data number string

Hello

I have a data entry, we will tell

'012345678 '.

How can I divide it into 3 data form numbers such as

"012" "345" "678"?

Looks like you have a fixed format, so you could do that.

Tags: NI Software

Similar Questions

  • How to divide the Dates

    Hi all...

    Here, I use the following scripts...

    create table a10 (eno number, date f, date t, number of sal)

    INSERT IN A10 (ENO, F, T, SAL) VALUES)

    1, TO_Date (1 July 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (June 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')

    (100);

    INSERT IN A10 (ENO, F, T, SAL) VALUES)

    1, TO_Date (May 1, 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (April 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')

    (200);

    COMMIT;

    entry:

    ENO      F             T                SAL

    07/01/2013 2014/06/30 100 1

    1 05/01/2013 30/04/2014 200

    Expected results:

    ENO FTSAL

    1 05/01/2013 2013/06/30 200

    1 30/04/2014 300 07/01/2013

    1 05/01/2014 2014/06/30 100

    I'm little bit confused how to divide the dates here... Any help is appreciated.

    Thank you all

    Stéphane

    Hello

    Always tell what version of Oracle you are using, especially if it's so old.

    In Oracle 10 (or 9, by the way) you can do this way:

    WITH cntr AS

    (

    SELECT LEVEL AS n

    OF the double

    CONNECT BY LEVEL<=>

    )

    got_change_date AS

    (

    SELECT d.eno

    C.n

    WHEN 1 THEN f

    ANOTHER t + 1

    END AS change_date

    C.n

    WHEN 1 THEN 1

    OF ANOTHER-1

    END as mul

    sal

    BY a10 d

    CROSS JOIN cntr c

    -WHERE... - If you need any filtering, put it here

    )

    got_total_sal AS

    (

    SELECT eno

    change_date f

    Advance (change_date) OVER (PARTITION BY eno

    ORDER BY change_date

    ) - 1 AS t

    SUM (sal * mul) over (PARTITION BY eno

    ORDER BY change_date

    ) AS total_sal

    OF got_change_date

    )

    SELECT *.

    OF got_total_sal

    WHERE t IS NOT NULL

    ORDER BY eno, f

    ;

  • TCP IP to receive and divide the data in real time

    I'm using labview 11 and I have a computer send data via tcp ip. The data string is like this P 22 33 44 P 22 44 66 P 22 33 11 P and so on are numbers between P x y and z co - ord, I need labview to receive this and separate each x y and z as separate outputs

    Two examples of analysis of some basic:

    The upper part is by using a regular expression, which is a lot more forgving the lower part that uses parsing the string. The analysis of the chain will work only if there is a space between the elements. The regular expression will work will allow multiple spaces.

  • Divide the data into separate rows

    Hi people,

    I have a request, which could be simplified as:

    with t as)

    "name select 'John', ' 7.3.2014' date_from, ' 13.3.2014 ' date_to, 'SICK DAY' reason for the double

    "" the name of Union select 'Mike', ' 28.3.2014 ' date_from, ' 2.4.2014 ' date_to, 'HOLIDAY' because of the double

    "" the name of Union select 'Tom', ' 14.3.2014 ' date_from, ' 14.3.2014 ' date_to, 'HOLIDAY' because of the double

    )

    Select * from t

    Each line includes a person's name, reason for his absence, the dates of and to.

    I would like to divide these lines in separate registers (for later analysis), so an expected output would look something like:

    with t as)

    name select 'John', ' 7.3.2014' absence_date, 'SICK DAY' reason for the double

    "the name of Union select 'John', ' 8.3.2014 ' absence_date, 'SICK DAY' reason for the double

    "the name of Union select 'John', ' 9.3.2014 ' absence_date, 'SICK DAY' reason for the double

    "the name of Union select 'John', ' 10.3.2014 ' absence_date, 'SICK DAY' reason for the double

    "the name of Union select 'John', ' 11.3.2014 ' absence_date, 'SICK DAY' reason for the double

    "the name of Union select 'John', ' 12.3.2014 ' absence_date, 'SICK DAY' reason for the double

    "the name of Union select 'John', ' 13.3.2014 ' absence_date, 'SICK DAY' reason for the double

    "the name of Union select 'Mike', ' 28.3.2014 ' absence_date, 'HOLIDAY' because of the double

    "the name of Union select 'Mike', ' 29.3.2014 ' absence_date, 'HOLIDAY' because of the double

    "the name of Union select 'Mike', ' 30.3.2014 ' absence_date, 'HOLIDAY' because of the double

    "the name of Union select 'Mike', ' 31.3.2014 ' absence_date, 'HOLIDAY' because of the double

    "the name of Union select 'Mike', ' 1.4.2014 ' absence_date, 'HOLIDAY' because of the double

    "the name of Union select 'Mike', ' 2.4.2014 ' absence_date, 'HOLIDAY' because of the double

    "the name of Union select 'Tom', ' 14.3.2014 ' absence_date, 'HOLIDAY' because of the double

    )

    Select * from t

    Please advice, how for the first example query to obtain a required output?

    Thank you

    Tomas

    SQL > with t as)
    2. Select the name of 'John '.
    3, to_date ("'07.3.2014', ' dd.mm.yyyy") date_from
    4, to_date ("'13.3.2014', ' dd.mm.yyyy") date_to
    5, 'SICK DAY' reason
    6 double
    7 union select name "Mike".
    8, to_date ("'28.3.2014', ' dd.mm.yyyy") date_from
    9, to_date ("'02.4.2014', ' dd.mm.yyyy") date_to
    10 at 'HOLIDAY '.
    11 double
    12 union select name of "Tom."
    13, to_date ("'14.3.2014', ' dd.mm.yyyy") date_from
    14, to_date ("'14.3.2014', ' dd.mm.yyyy") date_to
    15, because of "HOLIDAY".


    16 double
    17       )
    18 select name
    19, date_from + (level 1) leave_date
    20, reason
    21 t
    22 connect
    23 by level<= date_to="" -="" date_from="" +="">
    24 and prior name = name
    25 and prior sys_guid() is not null
    order 26
    27 by name
    28, leave_date;

    NAME LEAVE_DAT REASON
    ---- --------- --------
    John 7 March 14 SICK DAYS
    John 8 March 14 SICK DAYS
    John 9 March 14 SICK DAYS
    John 10 March 14 SICK DAYS
    John 11 March 14 SICK DAYS
    John 12 March 14 SICK DAYS
    John 13 March 14 SICK DAYS
    Mike HOLIDAY 28 March 14
    Mike HOLIDAY 29 March 14
    Mike HOLIDAY 30 March 14
    Mike HOLIDAY March 31, 14
    Mike HOLIDAY April 1, 14
    Mike VACATION April 2, 14
    Tom March 14 14 HOLIDAY

    14 selected lines.

    SQL >

  • How to divide the data in the column based identifier

    Hello

    I use the oracle database.
    I have data in this format in my column 1234 ~ 2345 ~ 3456 ~ 4567.

    I need a motion to split the data in the column based on the identifier ' ~', so that I can choose the value after the second occurrence of the identifier.


    Do I know who can do this.

    Published by: 962987 on October 3, 2012 12:11

    Hello

    Welcome to the forum!

    Whenever you have any questions, please post CREATE TABLE and INSERT statements for some examples of data and the results desired from these data. For example, in view of these data

    CREATE TABLE     table_x
    (       my_column     VARCHAR2 (40)
    );
    
    INSERT INTO table_x (my_column) VALUES ('1234~2345~3456~4567');
    INSERT INTO table_x (my_column) VALUES ('just~2 parts');
    

    I think you're asking for these results

    PART_3     MY_COLUMN
    ---------- ----------------------------------------
    3456       1234~2345~3456~4567
               just~2 parts
    

    I suppose that, if the string does not contain at least 2 ' ~ s, you want to return null. It's a good idea to explain what you want like that for special cases and include examples in your sample data and results.

    Not all versions of Oracle are exactly the same. In fact, they are all different. If you want the best solution that works with your version, then say what version it is.
    The following query will work in Oracle 10.1 and higher:

    SELECT  REGEXP_SUBSTR ( my_column
                    , '[^~]+'
                    , 1
                    , 3     -- 3rd occurrence (after 2nd delimiter)
                    )     AS part_3
    ,     my_column          -- if wanted
    FROM    table_x
    ;
    

    See the FAQ forum {message identifier: = 9360002}

    Published by: Frank Kulash, October 3, 2012 15:24
    Adding sample data and results.

  • convert the varchar2 data type to the data number type

    How to convert the varchar2 data type to the data type number.


    It looks like my data

    create table one)
    col1 varchar2 (50)
    col2 varchar2 (500);

    Insert in a (col1, col2) values ('1234 ', ' 2345');

    Select Column1 of number (19)) cast (to_number (col1);

    IAM getting error invalid number


    I need to create a table with the same columns with data like number types (19)

    can someone help me

    Thank you

    You have changed your original post, so now I see that you get the invalid number.

    This is why you should always avoid the varchar columns to store numbers or dates...

    Since your table source contains a nonnumeric value, you can write a pl/sql to convert data and see what records are false:

    SQL> insert into a (col1,col2) values ('xxxx','2345');
    
    1 row created.
    
    SQL> select * from a;
    
    COL1     COL2
    -------- --------
    1234     2345
    xxxx     2345
    
    2 rows selected.
    
    SQL> create table b (col1 number(19), col2 number(19));
    
    Table created.
    
    SQL> set serverout on
    
    SQL> declare
      2  cursor c is
      3  select * from a;
      4  begin
      5    for r in c loop
      6     begin
      7       insert into b values (to_number(r.col1), to_number(r.col2));
      8     exception
      9       when invalid_number then
     10        dbms_output.put_line('Row rejected: col1='||r.col1||' col2='||r.col2);
     11     end;
     12    end loop;
     13  end;
     14  /
    Row rejected: col1=xxxx col2=2345
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from b;
    
          COL1       COL2
    ---------- ----------
          1234       2345
    
    1 row selected.
    

    Max

    Published by: Massimo Ruocchio, June 14, 2011 20:00
    Added the first query in the example

  • Date to the Date object string

    Hello

    How I'd go on parsing the date in DD/MM/YYYY format strings in a date objects. I'm sure its an easy problem but I can't find a simple way to do as most of the API wants a different format as DD/MM/YYYY

    Thanks for any help

    Hello

    in the actionscript 3.0 Cookbook, there is a class DateFormat described, which allows to parse strings of objects date.

    You can download the code for the dateformat.as from there.

    http://www.rightactionscript.com/ASCB/

    Best regards
    Kcell

  • 1 source of eBS - 2 planning targets - how to divide the data?

    Hello

    I use FDM ERPI to load the data of the eBS in Hyperion Planning (eBS 11.5 and EMP 11.1.2.1).

    I have load data in planning of 2 databases (which are in the same application of planning), target adapters so 2 and two locations.

    The two locations have the same source and the same mapping.

    But some accounts must go to app1, while others must go to app2.

    But no information in gl on the target application.

    How could I do?

    The EPMA table or source file to see what plan enter each account is used?

    And when I should exclude accounts: in the import action? in the exportToDat?

    Thanks in advance for your halp, hoping it's clear...

    Fanny

    Fanny,

    If you will be cutting back, you will need to make separate FDM apps for each target card - it is the only way. FDM creates the drill by definition based on the "installation Code", as some call the default adapter. There cannot be an adapter by default, so to drill at work, it can be a card in the application.

    Until the FDM/Oracle solves this problem, you should not use multiple cards in one drill active FDM app.

    Kind regards
    Robb Salzmann

  • Divide the data into several lines in the table

    Hello

    I use apex of Oracle 10 g 3.2.

    I have a requirement like this.

    I have a table like TableA

    Col1 Col2
    90 1
    91 1:2:3
    92 3

    I want the data as

    Col1 Col2
    90 1
    91 1
    91 2
    91 3
    92 3

    How to do this?

    Thank you

    Published by: user13305573 on August 3, 2010 20:16
    with
       your_data as
    (
       select 90 as col1, '1'  as col2      from dual union all
       select 91, '1:2:3'   from dual union all
       select 92, '3'       from dual
    )
    select
       y.col1,
       regexp_substr(y.col2, '[^:]+', 1, t1.column_value) as col2
    from
       your_data y,
     13     table(cast(multiset(select level from dual connect by  level <= length (regexp_replace(y.col2, '[^:]+'))  + 1) as sys.OdciNumberList)) t1
     14  /
    
                  COL1 COL2
    ------------------ -----
                    90 1
                    91 1
                    91 2
                    91 3
                    92 3
    
    5 rows selected.
    
    Elapsed: 00:00:00.05
    ME_XE?select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    5 rows selected.
    
    Elapsed: 00:00:00.03
    ME_XE?
    
  • divide the data into lines

    Hello

    I have data like this.


    Person_wid industry

    111 car; Telecom


    How to divide as below


    Output:

    Auto 111

    Telecom 111


    Thank you


    SQL > test as

    () 2

    3 select person_wid 111, ' car. Telecom' double industry

    4)

    5. Select person_wid

    regexp_substr 6, (industry, ' [^;] +', 1, rn) split

    7 test

    8 cross

    9 join (select rownum rn

    10 in (select max (length (regexp_replace (industry, ' [^;] +'))) + 1 mx)

    11 test

    12                 )

    13 connect by level<=>

    14         );

    SPLIT PERSON_WID

    ---------- ------------------

    Auto 111

    Telecom 111

    2 selected lines.

    Notes on the Oracle: split delimited by a comma the way of RegExp string, second part

  • Difficulty to use indexing to divide the data into five sets of data

    Hello

    I'm using labview to program a mass spectrometer.  I want to conduct surveillance of the multiple ion where I watch the level of five different masses over time.  The five different masses correspond to five of the tensions that are sent via the DAC to my instrument.  After sending each voltage, a voltage was then read AIN.  The help of indexation and a for loop, I can send fill this function.

    My problem is to be able to plot these data.  I need a field of tension AIN (y) and the time (x) for five tension (mass) and plots to display on a single diagram.  I don't know how to correlate data from indexing to separate into five different mass and then repeat the experience by adding data to each mass using all loop.  When I tried I just get data tracing as a straight line as a set of data when I need five sets of data.

    I enclose my vi.  Any help would be great.

    Your VI base design is incorrect:

    • There is no reason for you to have 2 while loops. One is suffient.
    • You should not open the interface in each iteration of the loop. Open outside, do your work and then close when you are finished loop.

    Regarding the map, get rid of the inner loop and eliminate this Build table you have outside the loop for. In order to have a graphic draw several lines, you have need of a 2D array. Because you use a loop for to acquire a reading at the same time, you'll need create a 2D out of the loop for. To do this, put a table to build inside the loop, then a function of 2D matrix transposes outdoors. See the attached example.

  • Divide the data in row in different columns

    Hi all
    I have a table with a column as below.
    col1
    ------------
    / shared
    / shared/dashboard invites you
    / shared/dashboard of the guests/statistics_from_to_p
    / Shared/Filters
    / Shared/Filters/_filters
    / shared/Summary Reports
    / shared/reports/age_gender_r summary
    / shared/TRC explore _portal/edge/DB tables / dashboard layout

    Here, I want to split these data delimited by "/" and the need to show as below. I tried with substr and instr functions, but I could not achieve.
    col1 Col2 col3 col4 col5 col
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    / shared shared null null null null
    / shared/dashboard guest shared Dashboard prompt null null null
    / Shared/Dashboard Dashboard shared guests/statistics_from_to_p invites statistics_from_to_p null null
    / Shared/shared Filters filters null null null
    / Shared/Filters/_filters shared filters _filters null null
    / shared/Summary Reports shared null null null Summary Reports
    / Shared/Summary reports/shared age_gender_r null null age_gender_r summary reports
    Explore _portal/edge/DB tables layout / dashboard/Shared/TRC shared _portal TRC dashboard layout of dashboard Explorer tree
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Appreciate your help.

    Thank you.
  • Divide the dates in different shifts.

    Hi all

    I am trying to configure a query to get my date ranges in shifts from 8: 00 to 23:00, 07:00 to 15:00.
    create table t (start_date, end_date)
    
    insert into t values (to_date('11-21-12 21:02:15', 'MM-dd-yy HH24:MI:ss'), to_date('11-21-12 21:02:51', 'MM-dd-yy HH24:MI:ss'));
    insert into t values (to_date('11-21-12 21:09:06', 'MM-dd-yy HH24:MI:ss'), to_date('11-24-12 23:30:18', 'MM-dd-yy HH24:MI:ss'));
    insert into t values (to_date('11-24-12 23:35:28', 'MM-dd-yy HH24:MI:ss'), to_date('11-24-12 23:49:34', 'MM-dd-yy HH24:MI:ss'));
    Desired output:
    START_DATE        | END_DATE
    11-24-12 23:35:28 | 11-24-12 23:49:34
    11-24-12 23:00:00 | 11-24-12 23:30:18
    11-24-12 15:00:00 | 11-24-12 23:00:00
    11-24-12 07:00:00 | 11-24-12 15:00:00
    11-23-12 23:00:00 | 11-24-12 07:00:00
    11-23-12 15:00:00 | 11-23-12 23:00:00
    11-23-12 07:00:00 | 11-23-12 15:00:00
    11-22-12 23:00:00 | 11-23-12 07:00:00
    11-22-12 15:00:00 | 11-22-12 23:00:00
    11-22-12 07:00:00 | 11-22-12 15:00:00
    11-21-12 23:00:00 | 11-22-12 07:00:00
    11-21-12 21:09:06 | 11-21-12 23:00:00
    11-21-12 21:02:15 | 11-21-12 21:02:51
    Version:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production

    Is this possible?

    Thanks in advance!

    Another way:

    with a as (
               select  trunc(min(start_date)) + 7 / 24 first_first_shift_date,
                       trunc(max(end_date)) + 23 / 24 last_last_shift_date
                 from  t
              ),
         b as (
               select  first_first_shift_date + 8 / 24 * (level - 1) sfift_start_date
                 from  a
                 connect by first_first_shift_date + 8 / 24 * (level - 1) <= last_last_shift_date
              ),
         c as (
                select  start_date,
                        1 indicator
                  from  t
               union all
                select  end_date,
                        2
                  from  t
               union all
                select  sfift_start_date,
                        1
                  from  b,
                        t
                  where sfift_start_date > start_date
                    and sfift_start_date < end_date
              ),
         d as (
               select  start_date,
                       lead(start_date) over(order by start_date) end_date,
                       indicator
                 from  c
              )
    select  start_date,
            end_date
      from  d
      where indicator = 1
      order by start_date desc
    /
    
    START_DATE          END_DATE
    ------------------- -------------------
    11/24/2012 23:35:28 11/24/2012 23:49:34
    11/24/2012 23:00:00 11/24/2012 23:30:18
    11/24/2012 15:00:00 11/24/2012 23:00:00
    11/24/2012 07:00:00 11/24/2012 15:00:00
    11/23/2012 23:00:00 11/24/2012 07:00:00
    11/23/2012 15:00:00 11/23/2012 23:00:00
    11/23/2012 07:00:00 11/23/2012 15:00:00
    11/22/2012 23:00:00 11/23/2012 07:00:00
    11/22/2012 15:00:00 11/22/2012 23:00:00
    11/22/2012 07:00:00 11/22/2012 15:00:00
    11/21/2012 23:00:00 11/22/2012 07:00:00
    
    START_DATE          END_DATE
    ------------------- -------------------
    11/21/2012 21:09:06 11/21/2012 23:00:00
    11/21/2012 21:02:15 11/21/2012 21:02:51
    
    13 rows selected.
    
    SQL> 
    

    SY.

  • How to divide the column Date OBIEE

    Hello
    We have the name of the date column: To_Date and the format is DD/MM/YY hh.
    How to divide the date in YEARS, MONTHS, DAY as new columns.
    kindly help on that.


    Kind regards.
    CHR

    Published by: 867932 on November 23, 2011 22:18

    Hi user,

    All 3 functions can be written in RPD too. MDB layer, duplicate the date column-> the mapping tab to column of Goto-> expression-> functions Builder Select-> calendar Date functions / hour-> select DayofMOnth function. The column of your logic formula will look like,

    DayofMonth (YourDateColumn)

    Rgds,
    DpKa

  • Get date friendly String

    Hi all

    I try to get Sunday, August 15, 2010-08 - 15. I divided the date and everything works without error when I call myDate.toString (); It does not give the desired result.

    Calendar calendar = Calendar.GetInstance ();
    Calendar.Set (Calendar.DAY_OF_MONTH, Integer.parseInt(second[2]));
    Calendar.Set (Calendar.MONTH, Integer.parseInt(second[1]));
    Calendar.Set (Calendar.YEAR, Integer.parseInt(second[0]));

    Date myDate = calendar.getTime ();

    Can someone tell me what I need to do next to get Sunday, August 15?

    Thank you

    Alex

    Try this,

    This code gives u what you want

            Date date = new Date();
            date.setTime(System.currentTimeMillis());
            String str=date.toString());
    

    -------------------------------------------------------------------------------------------------------

    Press Button Kudoes to say thanks to your help, if got the answer and the press also accept as a Solution button.

Maybe you are looking for