SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

STRING SPLIT

Name:
    STRING SPLIT
Type:
    Let Subcommand
Purpose:
    Extract the individual words from a currently existing string.
Description:
    This command is used to extract the individual words from a string.

    This command is an alternative to using STRING WORD. STRING WORD is used to extract a specific word in the string while STRING SPLIT will extract all the words in a string to individual strings. Note that only the base name will be specified. For example, if you specify SOUT as the base name and there are three words in the original string, then string SOUT1 will contain the first word, SOUT2 will contain the second word, and SOUT3 will contain the third word.

    In Dataplot, spaces are used to separate words.

Syntax:
    LET <sout> = STRING SPLIT <sorg>
    where <sorg> is the name of a pre-existing string;
    and     <sout> is the base name of the resulting strings.

    The <sout> defines the base name. An integer index will be appended to the base name for each string (the index starts at 1).

Examples:
    LET STBASE = STRING SPLIT SORG
Note:
    The original string being processed must be a pre-existing string. If you want to split literal text, you need to do something like

      LET STRING SORG = xxxx yyyy zzzz
      LET SOUT = STRING SPLIT SORG

    Using

      LET SOUT = STRING SPLIT xxxx yyyy zzzz

    will not work. It will try to see if "xxxx" is the name of currently defined string. If it is not, no new strings will be created. Enclosing the literal text in quotes will not make this work.

    The name on the left hand side of the equal sign may be a previously existing string. However, if it is a previously existing parameter, variable, or matrix name, an error will be reported and the requested string will not be created.

Note:
    By default, Dataplot uses a space as the word delimiter. You can specify an alternative character to be the word delimiter with the command

      SET WORD DELIMITER <char>

    with <char> denoting the character to use as the word delimiter.

Note:
    Starting with the 2020/08 version of Dataplot, the parameter NUMBWORD is automatically created. This parameter contains the number of strings that are created by this command.
Note:
    The total number of characters that DATAPLOT can use for storing functions and strings is set when DATAPLOT is built. The current default (11/2008) is 50,000 characters. Previous versions may set this limit at 1,000 or 10,000 characters. This limit applies to the combined number of characters for all functions and strings.
Default:
    None
Synonyms:
    None
Related Commands: Applications:
    Data Management
Implementation Date:
    2018/10
    2020/08: Automatically save NUMBWORD parameter
Program:
     
    LET STRING SORG = X1 X2 X3 X4 X5
    LET SNAME = STRING SPLIT SORG
    PRINT SNAME1 SNAME2 SNAME3 SNAME4 SNAME5
        
    The following output is returned
     FUNCTIONS--
    
         SNAME1  --X1
         SNAME2  --X2
         SNAME3  --X3
         SNAME4  --X4
         SNAME5  --X5
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 10/10/2018
Last updated: 08/28/2020

Please email comments on this WWW page to alan.heckert@nist.gov.