TMI Script
This task allows Dex to call out to TMI scripts. TMI is a programming language specifically designed and developed for manipulating the Dex data stream.
OPTION | DESCRIPTION |
---|---|
TMI Script | The TMI Script to be run. |
Load | Load a TMI script from disk. |
Save | Save a TMI script to disk. |
INPUT
There are no special input requirements, however, the script itself may have dependencies.
OUTPUT
At the end of execution, whatever the TMI table value "dex" becomes, is returned as the Dex output data stream after having executed the TMI script.
EXAMPLES
The best way to learn TMI quickly is by example. Since TMI is a synthesis of SQL, Perl, with some intrinsically supported CSV/table operations, manipulating Dex data within TMI is a snap.
Creating a Dataset
dex = [ [ NAME, AGE ] [["Bob", 39],["Sally", "22"]]];
Creates the Dex output datastream represented by the table:
NAME | AGE |
---|---|
Bob | 39 |
Sally | 22 |
Selecting From A Dataset
Given a table named T1:
NAME | AGE | GENDER |
---|---|---|
Bob | 39 | Male |
Sally | 22 | Female |
Pat | 45 | Male |
Jan | 49 | Female |
Select only Name and age
T2 = select NAME, AGE from T1;
Setting the Dex Data Stream
Any assignment to "dex" will be reflected in the data output stream.
dex = T2;
Will send the results from the previous example to the Dex data output stream.
Returning only Males
dex = select NAME, AGE from dex where GENDER == "Male";