Specified Line Extraction (in: String type A/ Numeric type B, out: String type C)

Extracts a specified line from a String type data item (multiple line) and sets it in another String type data item. It can be used for loop processing of multiple line list line by line.

    A. Select STRING DATA for multiple lines of textData selectString(multiple line)Required
    B. Select NUMERIC DATA for the line number (at least 1)Data selectNumericRequired
    C. Select STRING DATA for extracted string (update)Data selectString(single line)Required
    -variable namevariable label
    Aconf_DataIdASelect STRING DATA for multiple lines of text
    Bconf_DataIdBSelect NUMERIC DATA for the line number (at least 1)
    Cconf_DataIdCSelect STRING DATA for extracted string (update)
    //// == 自動工程コンフィグの参照 / Config Retrieving ==
    var dataIdA = configs.get("conf_DataIdA");
    var dataIdB = configs.get("conf_DataIdB");
    var dataIdC = configs.get("conf_DataIdC"); // returns key
    
    //// == ワークフローデータの参照 / Data Retrieving ==
    var targetText = data.get( dataIdA ) + "";
    var targetLineNum = data.get( dataIdB ) - 0;
    
    //// == 演算 / Calculating ==
    var linesArray = targetText.split("\n");
    var extractedStr = linesArray[ targetLineNum - 1 ];
    
    //// == ワークフローデータへの代入 / Data Updating ==
    retVal.put( dataIdC, extractedStr );
    

    • A’: Text stored in the Data Item selected at config A
    • A’: Numeric value stored in the Data Item selected at config B
    • The character string of line B’ in text A’ is extracted and stored in the String type Data Item selected at config C
    • If the line number to extract is larger than the number of text lines, data will not be retrieved (Character string of “undefined” is set)