<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !DIC.-Delimited Item Commands |
MiniRobotLanguage (MRL)
DIC. Command
Delimited Item Commands
These commands are for Excel- and CSV-Files.
You can
- remove Columns,
- Insert Columns,
- Swap Columns.
- return only those Columns you want
- return only those Columns you want in the order you want
In real life many information is stored in Excel-Files, and often we have to work with these.
Using SBD. it was always possible to use with Excel-CSV-Files.
Now using the new DIC.-Commands, many tasks that needed to be programmed before,
can now done with just 1 Line of Code.
.
The DIC.-Command works on "Line-by-Line" Base.
Therefore you will normally load the "csv"-File using the TXT.-Commands.
And then work on it "Line-by-Line" using the DIC.-Commands.
DIC.Swap|$$DEL|$$LIN|$$INA|$$INB|$$RES
DIC.Insert|$$DEL|$$LIN|$$IND|$$RES
DIC.remove|$$DEL|$$LIN|$$IND|$$RES
DIC.Get_in_Order|$$DEL|$$LIN|$$IND|$$RES
DIC.Get_Fields|$$DEL|$$LIN|$$IND|$$RES
Now here are some Samples for the DIC.-Commands:
' Get only the specified fields in the specified Order
VAR.$$DEL=;
VAR.$$LIN=AA;BB;CC;DD;EE;FF
VAR.$$IND="C","E",1,6,4
DIC.Geo|$$DEL|$$LIN|$$IND|$$RES
' returns: CC;EE;AA;FF;DD
DBP.$$RES
ENR.
' Get only the specified fields in original Order
VAR.$$DEL=;
VAR.$$LIN=AA;BB;CC;DD;EE;FF
VAR.$$IND="A","E",2
DIC.Get|$$DEL|$$LIN|$$IND|$$RES
' returns: AA;BB;EE
DBP.$$RES
ENR.
' Swap the two Columns $$INA and $$INB
VAR.$$DEL=;
VAR.$$LIN=AA;BB;CC;DD;EE;FF
VAR.$$INA="A"
VAR.$$INB="E"
' returns: EE;BB;CC;DD;AA;FF
DIC.Swap|$$DEL|$$LIN|$$INA|$$INB|$$RES
DBP.$$RES
ENR.
' Insert Columns before the specified places
VAR.$$DEL=;
VAR.$$LIN=AA;BB;CC;DD;EE;FF
VAR.$$IND="A","E"
DIC.Insert|$$DEL|$$LIN|$$IND|$$RES
' returns: ;AA;BB;CC;DD;;EE;FF
DBP.$$RES
ENR.
' remove specified Columns
VAR.$$DEL=;
VAR.$$LIN=AA;BB;CC;DD;EE;FF
VAR.$$IND="A","E",3
DIC.remove|$$DEL|$$LIN|$$IND|$$RES
' returns: BB;DD;FF
DBP.$$RES
ENR.
See also: