How to split the string from character position.

HI ALL,
I need to split the string like this.
example:
String = "HelloWorld"
mid("HelloWorld", 2, 5);
it should print   "ello"
menas mid is functiuon it will split "HelloWorld" from 2nd character to 5th character and prints "ello".
This one how to do in labview.
Regards
Punith

String Subset is the function you are looking for.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • How to split the string by datetime in sql

    Hi,
    How to split the string by datetime in sql, I've a table with comments column stores comments by datetime, while selecting I want to split and show as in rows by each jobref.
    can anyone help me in this please.
    Thanks,

    declare @callcentre table (comments varchar(max),lbiref varchar(200))
    insert into @callcentre
    select '(28/10/2014 14:56:14) xyz ..... call  logged   (28/10/2014 14:56:58) xyz ..... call updated   (28/10/2014 14:57:41)xyz ..... call updated','Vi2910201'
    insert into @callcentre
    select '(29/10/2014 14:56:14) xyz ..... call  logged   (29/10/2014 14:56:58) xyz ..... call updated   (29/10/2014 14:57:41)xyz ..... call updated','Vi2910202'
    insert into @callcentre
    select '(30/10/2014 14:56:14) xyz ..... call  logged   (30/10/2014 14:56:58) xyz ..... call updated  
    output:
    1) 28/10/2014 14:56:14, (28/10/2014 14:56:14) xyz ..... call  logged ,'Vi2910201'
     2) 28/10/2014 14:56:58 ,(28/10/2014 14:56:58) xyz ..... call updated ,'Vi2910201'
    3) 28/10/2014 14:57:41,  (28/10/2014 14:57:41)xyz ..... call updated,'Vi2910201'
    4) 28/10/2014 14:56:14, (28/10/2014 14:56:14) xyz ..... call  logged ,'Vi2910202'
     5) 28/10/2014 14:56:58 ,(28/10/2014 14:56:58) xyz ..... call updated ,'Vi2910202'
    6) 28/10/2014 14:57:41,  (28/10/2014 14:57:41)xyz ..... call updated,'Vi2910202'
    7) 28/10/2014 14:56:14, (28/10/2014 14:56:14) xyz ..... call  logged ,'Vi2910203'
     8) 28/10/2014 14:56:58 ,(28/10/2014 14:56:58) xyz ..... call updated ,'Vi2910203'
    Thanks,
    See this illustration
    declare @callcentre table (comments varchar(max),lbiref varchar(200))
    insert into @callcentre
    select '(28/10/2014 14:56:14) xyz ..... call logged (28/10/2014 14:56:58) xyz ..... call updated (28/10/2014 14:57:41)xyz ..... call updated','Vi2910201'
    insert into @callcentre
    select '(29/10/2014 14:56:14) xyz ..... call logged (29/10/2014 14:56:58) xyz ..... call updated (29/10/2014 14:57:41)xyz ..... call updated','Vi2910202'
    insert into @callcentre
    select '(30/10/2014 14:56:14) xyz ..... call logged (30/10/2014 14:56:58) xyz ..... call updated','Vi2910203'
    SELECT LEFT(p.u.value('.[1]','varchar(max)'),CHARINDEX(')',p.u.value('.[1]','varchar(max)'))-1) AS [Date],
    '(' + p.u.value('.[1]','varchar(max)') AS comments,
    lbiref
    FROM
    SELECT lbiref,CAST('<Root>' + STUFF(REPLACE(comments,'(','</Data><Data>'),1,7,'') + '</Data></Root>' AS XML) AS x
    FROM @callcentre c
    )t
    CROSS APPLY x.nodes('/Root/Data')p(u)
    and the output
    Date comments lbiref
    28/10/2014 14:56:14 (28/10/2014 14:56:14) xyz ..... call logged Vi2910201
    28/10/2014 14:56:58 (28/10/2014 14:56:58) xyz ..... call updated Vi2910201
    28/10/2014 14:57:41 (28/10/2014 14:57:41)xyz ..... call updated Vi2910201
    29/10/2014 14:56:14 (29/10/2014 14:56:14) xyz ..... call logged Vi2910202
    29/10/2014 14:56:58 (29/10/2014 14:56:58) xyz ..... call updated Vi2910202
    29/10/2014 14:57:41 (29/10/2014 14:57:41)xyz ..... call updated Vi2910202
    30/10/2014 14:56:14 (30/10/2014 14:56:14) xyz ..... call logged Vi2910203
    30/10/2014 14:56:58 (30/10/2014 14:56:58) xyz ..... call updated Vi2910203
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How To Split the String for "."

    Hi Friends
    I am Using Following Code to Split one String.
    String str = "Jeetendra.choudhary";
    String[] sp_str = str.split(".");
    wdComponentApi.getMessageManager.reportSuccess(str[0]);
    wdComponentApi.getMessageManager.reportSuccess(str[1]);
    but its throwing null pointer exception. 
    when i am using following code its working fine.
    String str = "Jeetendra/choudhary";
    String[] sp_str = str.split("/");
    wdComponentApi.getMessageManager.reportSuccess(str[0]);
    wdComponentApi.getMessageManager.reportSuccess(str[1]);
    what may be the issue and how to split the string with "." ?
    Thanks & Regards
    Jeetendra

    "." is a special character.
    Use
    str.split("\\.");
    Regards
    Benjamin
    Edited by: Benjamin Hansen on Dec 29, 2009 7:52 AM

  • How to split the string?

    Hi Experts,
    Can anyone explain me with code how to separate the single character from the given input string?
    For Example: Input String str = 'RAGHU'
    Output should be:
    R
    RA
    RAGH
    RAGHU
    RAGH
    RAG
    RA
    R
    Can anyone help me with code for above required output?
    Thanks in Advance,
    Regards,
    Raghu.

    HI,
    sy-index will give u the iteration number.
    first of all in this program u are counting the length of the string and it was in variable LEN.
    we are always printing the string from 0 index(1st character) to POS number of characters.
    length is 5 so LNG = 5 * 2 = 10 and LNG = 10 - 1 = 9.and first sy-index = 1.so,1 <= 5 so POS = 0 + 1 = 1. it is printing the first char
    second sy-index = 2.so,2 <= 5 so POS = 1 + 1 = 2. it is printing the first two chars
    third sy-index = 3.so,3 <= 5 so POS = 2 + 1 = 3. it is printing the first three chars
    forth sy-index = 4.so,4 <= 5 so POS = 3 + 1 = 4. it is printing the first four chars
    fifth sy-index = 5.so,5 <= 5 so POS = 4 + 1 = 5. it is printing the first five chars
    sixth sy-index = 6.so,6 > 5 so POS = 5 - 1 = 4. it is printing the first four chars
    seventh sy-index = 7.so,7 > 5 so POS = 4 - 1 = 3. it is printing the first three chars
    eighth sy-index = 8.so,8 > 5 so POS = 3 - 1 = 2. it is printing the first two chars
    ninth sy-index = 9.so,9 > 5 so POS = 2 - 1 = 1. it is printing the first char
    rgds,
    bharat.

  • How to Split the string using Substr and instr using loop condition

    Hi every body,
    I have below requirement.
    I need to split the string and append with single quotes('') followed by , (comma) and reassign entire values into another variable. so that i can use it where clause of update statement
    for example I am reciveing value as follows
    ALN varchar2(2000):=(12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434);
    Note: In the above variable i see 8 transactions, where as in real scenario i donot how many transaction i may recive.
    after modification i need above transactions should in below format
    ALTR Varchar2(2000):=('12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434');
    kindly help how to use substr and instr in normal loop or for loop or while loop while modifying the above transactions.
    Please help me to sort out this issue.
    Many Thanks.
    Edited by: user627525 on Dec 15, 2011 11:49 AM

    Try this - may not be the best way but...:
    create or replace type myTableType as table of varchar2(255)
    declare
    v_array mytabletype;
    v_new_str varchar2(4000);
    function str2tbl
             (p_str   in varchar2,
              p_delim in varchar2 default '.')
             return      myTableType
        as
            l_str        long default p_str || p_delim;
             l_n        number;
             l_data     myTableType := myTabletype();
        begin
            loop
                l_n := instr( l_str, p_delim );
                exit when (nvl(l_n,0) = 0);
                l_data.extend;
                l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));
                l_str := substr( l_str, l_n+length(p_delim) );
            end loop;
            return l_data;
       end;
    begin
      v_array := str2tbl ('12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434', ',');
          FOR i IN 1 .. v_array.COUNT LOOP
             v_new_str := v_new_str || ''''||v_array(i)||'''' || ',';
          END LOOP;
       dbms_output.put_line(RTRIM(v_new_str, ','));
    end;  
    OUTPUT:
    =======
    '12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434'HTH
    Edited by: user130038 on Dec 15, 2011 12:11 PM

  • How to save the string from JTextFied to database?

    can i know how to save the data from JTextFied to databse. Is it using update?

    The most straightforward way would be something like:
    String myKey=myKeyField.getText();
    String foo=fooField.getText();
    String sql="update mytable set foo='"+foo+"' where mykey='"+myKey+"'";
    connection.createStatement().executeUpdate(sql);
    This example assumes that the input fields cannot possibly contain quotes or the string won't be built correctly. Which by the way brings up a question I'd be interested in hearing others answer: What do you do about this? Sometimes I use PreparedStatement which handles that problem, other times I write my own little function to escape the string properly.
    You can also read the record into a ResultSet and use ResultSet.update(). I'm mostly using mySql and I found that in mySql ResultSet.update just creates a SQL update statement like I did above and executes it, so the only real advantage would be if you find the syntax more convenient. Perhaps other database drivers do something different that would give other pros and cons.

  • How to split a string - special character help need

    hai all ,
    i want to split a string
    eg: this is the text file
    dsgdsggdsgdsgds [dhana]
    hsdhsdhdsh
    sdhdshhdsh
    sdjsdhdshdsh hdshsd hsahsh
    hdfhhshs [sekaran]
    dfhdhdh
    i want to take only dhana & sekaran . which is in between the square bracket Special character "[   ] "
    thanks
    dhana

    My now classical RegExp test class:
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    * @author notivago     11/01/2005
    * @version 1.0
    public class RegTest {
        public static void main(String[] args) {
            RegTest test = new RegTest();
            // test.classFind();
            test.dharma();
            test.kharma();
        public void classFind() {
            Pattern p = Pattern.compile( "class\\s+(\\w+)(?:\\s+extends\\s+(\\w+))?(?:\\s+implements\\s+(\\w+)(?:,\\s*(\\w+))*)?\\s*\\{");
            Matcher m = p.matcher( "public class MyClass extends Esta implements Aquela, MaisUma { " );
            m.find();
            System.out.println("Match");
            System.out.println( m.group()  );
            System.out.println( "Class name: " + m.group(1) );
            System.out.println( "Extends: " + m.group(2) );
            for( int i = 3; i < m.groupCount(); i++) {
                System.out.println( "Implements: " + m.group(i) );
        public void stringBreak() {
            Pattern p = Pattern.compile( "([0-9]++\\s++)");
            Matcher m = p.matcher( "1111       22222       333333       444    5     " );
            for( int i = 0; m.find(); i++ ) {
                System.out.println( "Match "+ i + ": [" + m.group(0) + "]" );
        public void dharma() {
            Pattern p = Pattern.compile( "(dhana|sekaran)");
            Matcher m = p.matcher( "dsgdsggdsgdsgds [dhana]\nhsdhsdhdsh\nsdhdshhdsh\nsdjsdhdshdsh hdshsd hsahsh\nhdfhhshs [sekaran]\ndfhdhdh" );
            for( int i = 0; m.find(); i++ ) {
                System.out.println( "Match "+ i + ": " + m.group(0)  );
        public void kharma() {
            Pattern p = Pattern.compile( "[\\[](dhana|sekaran)[\\]]");
            Matcher m = p.matcher( "dsgdsggdsgdsgds [dhana]\nhsdhsdhdsh\nsdhdshhdsh\nsdjsdhdshdsh hdshsd hsahsh\nhdfhhshs [sekaran]\ndfhdhdh" );
            for( int i = 0; m.find(); i++ ) {
                System.out.println( "Match "+ i + ": \t" + m.group(0)  );
                System.out.println( "Sub-match "+ i + ": \t" + m.group(1)  );
    }May the code be with you.

  • How to split words alone from text ?

    how to split the text from a text file even with out the special characters to be stored to DB.I have seperated words using split.but it is having special charecters. is there any option with split to give special characters too as delimiters (i mean multilple delimiters).
    Or any other way to get the words and integers alone?

    gs_ravishankar wrote:
    i think his problem is he has a file which has some text row wise, this text contains different special characters.
    and his job is to read the text from the file and remove all special characters in the text and store this string in DB.
    if this is the case,
    i would suggest to get the ascii value range of all special characters and then write a condition for it.
    may be something like this
    if(text.chatAt(i) >= 12 && text.charAt(i) <= 45)
    text.replace();Jeebus, have you ever heard of regular expressions?

  • Returning the string from the SimpleDateFormat

    Hi guys,
    Can someone tell me how to return the string from the SimpleDateFormat?
    I've created the method to do this, but i don't know the exact code to use. Here's my code so far...
        public String convert (Calendar gc)
            String s = convert(gc);
            return // I need to return the s here, but don't know how to code it.
        }BTW, i've already wrote the code for the SimpleDateFormat (so if you want me post that, i will).

    DrLaszloJamf wrote:
    LevelSix wrote:
    DrLaszloJamf wrote:
    No.Can you tell me what it is, because i've went through the API and i don't know.
    Have you looked for a tutorial: [http://java.sun.com/docs/books/tutorial/i18n/format/dateintro.html]
    Thanks a lot DrLaszloJamf, this is useful.
    DrClap wrote:
    Nope. Suppose you were on a construction site and the foreman told you to move a pile of concrete blocks from a truck into the building. What do you suppose would happen if you asked the foreman what a concrete block was, and where the building was, and whether you should drive the truck into the street, and then you tried to pick up the whole pile all at once, and then you asked if you could kick the blocks like footballs? This is what you're doing here. You'd be fired from the construction site within half an hour.Sir...

  • How to split a string for 2 different matching patterns?

    hey guys
    i'm trying to split a string, using .split(regular expression), if two different pattern matches but i don't know the exact syntax for it. I want to split the string from letters and punctuations.
    This is what i'm doing, obviously it's not working, i'm not too sure if syntax are correct.
    String inputDigit [] = input.split("([a-zA-Z]) (\\p{Punct})");Please help me with this, thank you!

    Can you describe in more detail what you're trying to
    accomplish?ok, basically if you have a string which consists of letters, digits and punctuations. All i'm trying to do or want to do is store all digist within that string into an array. Therefore, i'm using split method to split the string wherever you find a letter or a punctuation. But i don't know what is syntax for using two different patterns at the same time.
    // For example if you have a string "Eeyore 61 2.986PoohPiglet007Kanga-23"
    // i only want: 61 2 986 007 23. I know i can use substring // but that would be a slightly long process

  • How to search/split a string from visa read

    hello all, i have a string coming from the serial port... the pattern is:
    \00\s\s\s\s0,\s\s\s\s12,\s\s\s\s\s0,\s\s\s\s\s0\r\n
    where the data is read as 0, 12, 0 , 0. i would like to save this data into a Write to Measurement File, for which i have to convert this text data into decimal format. can anyone please suggest me how to reduce the data from the string? I know I can save the data in a text file, but i am limited to use the Write to Measurement FIle.vi
    please help.
    Now on LabVIEW 10.0 on Win7

    Hello LV_Enthu,
    Have you played around with the functions in the Functions palette>>String at all? There are a few helpful functions like search/split strings and match string pattern that can be helpful, but here is an example from our website as well that does just this. Please let me know if you have any further questions.
    Thank you,
    Deborah Y.
    LabVIEW Real-Time Product Marketing Manager
    Certified LabVIEW Architect
    National Instruments

  • How to move the value from a character field to numeric or packed decimal

    Hi,
    can anyone explain me on how to move the value from a character field to numeric or packed decimal.
    Please help me on this. Thanks...
    Regards,
    Rose.

    Hi ,
    if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
    i doubt wherther it is HRCM or HCRM just try using *
    this will suit ur requirement.
    Regards,
    KK

  • How to read a string from file & assign the val to a variable in batch file

    Hi,
    How to read a string from a file and assign the value to a variable then return the value to the screen in windows batch file?
    Any suggestions?
    thanks.

    Unless this is a homework question then I don't see the purpose of doing this, but....
    You should be looking a the supplied package utl_file to get the string out of the file, dbms_output to display the string and then google windows batch/command files calling sqlplus to execute your program.
    Andre

  • How to search a string from the database?

    how to search a string from the database? starting with some character

    If you're trying to do this in a SELECT, you can use the LIKE verb in your WHERE clause.
    Here's an Example
      SELECT obj_name FROM tadir
        INTO prog
        WHERE pgmid = 'R3TR'
          AND object = 'PROG'
          AND obj_name LIKE 'Z%'.
    In this case it will select every row that obj_name starts with Z. 
    If you wanted to find every row that the field obj_name contains say... 'WIN'  you use LIKE '%WIN%'.
    Edited by: Paul Chapman on Apr 22, 2008 12:32 PM

  • How to split a string around "." expression

    My code is:
    public String removeExtn(String resource){
              String[] splittedName = resource.split(".");
    System.out.println("LENGHT IS: "+ splittedName.length);
              if(splittedName.length >= 3)
                   resource = splittedName[0]+ "." + splittedName[1];
              return resourceName;
         * @param args
         public static void main(String[] args) {
              Test obj = new Test();          
              System.out.println(obj.removeExtn("myfile.xml.sample"));
    But it doesn't split the string around "." and given the arraylength 0. But if I try to use any another character (e.g. "," or ";") it works perfectly fine.
    Please help me.
    Thanks in advance.
    Mansi

    Hi mansi,
    I had a same kind of problem a few days back.
    What I learned was the split() method has a string expression in it, which is usually noted as regex .
    'Regex' is just a short form for 'regular expression'
    You may directly use the string variable you would split around in some cases or may want to use a '\\' before some of the characters.
    I can't place whole information here .So, let me give you that sun site link I read it from.
    This link deals with the whole string class.
    You may want to ctrl+F and split to read on split method.
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.htmlThis link talks about the regular expressions
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html#sumI got his for you from that link :
    \p{Punct} Punctuation: For One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ This is for your knowledge.
    And if you want a quick fix just for your code...
    that'ld be using a
    split(\p{.}) in place where u used a split(.)I have not tried that ...but u may want to!
    Hope that helps.
    Message was edited by:
    Kishorei20
    Message was edited by:
    Kishorei20

Maybe you are looking for

  • Windows 7 64-bit: iTunes 9 throws Error 7 on launch.

    New install of Windows 7 64-bit Enterprise, with personal files transfered form a Vista install. Tried to install iTunes 8.2.1, but got an error. Decided to wait for the new, improved version of iTunes. Uninstalled as much iTunes 8 as showed up in th

  • Text Functions Not Appearing in PDF (Financial Reports)

    In the header of Financial Reports we are using common text functions to create the report titles with POVAlias and related functions. These headers correctly appear when printing or web viewing the reports. However, when viewing or printing to PDF -

  • SRM PPS with Document Builder

    Hi, We installed SRM 7.0 SP8 with PPS. How do I activate Document Builder. As per configuration guide i didn't see /IPRO/FND_DOCUMENT_BUILDER business function. Couple of Question 1. Is it Add-On installation required for Document Builder ? 2. What i

  • Has anyone bought a book with the itune card?

    I bought a $50 itune card. The small print on the back of the card says "Not redeemable for all purchases, such as ipod games, or app store purchases." I'm only interested in buying books. Can someone confirm that it works to buy books?

  • IPad 2 vs mac book pro

    I hv n iPad 2. Shud I buy MacBook pro just for flash player