[Javascript]Tokenizer

This recipe shows how to implement a tokenizer in a processor within composite datasource using JavaScript.

Steps taken:

  1. Create a composite datasource (Data_cmp.ds). Drag and drop the tabular datasource (Data.ds) as the beginning of the flow.
  2. Add a “Processor” element following the tabular datasource. Select “General > JavaScript”. Enter the following script into the “processRecord” tab page:importScript("/Elixir/ER_Cookbook/Data-Designer/DS-Composite/Processor/JavaScript/Tokenizer01/resource/Tokenizer.js")
    var tokens = data.tokenize(",", “”, true);for ( x in tokens)
    {
    var out = this.newRecordInstance();
    var outData = out.getData();
    outData[0] = tokens[x];
    next.processRecord(out);
    }

To download the necessary files for this recipe, refer to the attached ZIP file.
Tokenizer01.zip