Leverage Your Data.


Split data fields of a CSV data row to separate rows


This function can be used to wrap data fields from a single CSV row into multiple separate rows for output. The first field or fields remain the same in each generated row, followed by two new fields: the respective column heading and the contents.
This command can only be used for output control, not for reading a CSV file.
Starting with the second column, all subsequent fields are split into separate rows.
Each output row consists of three fields:
Field[1], the respective column name in a separate column, and the respective field content in a separate column.
Starting with the fourth column (4), the subsequent fields are divided into individual lines.
Each output line consists of the preceding fields [1]-[3], the column name in a separate column, and the field contents in a separate column.
%slice["Field Name"]
Starting with the column Field Name the subsequent fields are divided into individual lines.
Each output row consists of all fields preceding the column Field Name, the column name in a separate column, and the field contents in a separate column.

Special feature

As the new table will have some additonal columns for each "sliced" value, a number of new generic column titles COLUMN_TITLE and COLUMN_VALUE are created during output.
If the command %merge is used, there will even be new columns für each column of every merged file. See also %merge .

These columns should be renamed as desired.
Do this by using, for example: +rename[COLUMN_TITLE]="My New Title" +rename[COLUMN_VALUE]="My New Value" to match the meaning of the output file columns.


This is a tabular weekly schedule as csv:

MondayMuesliColorful garden saladNoodle soup
TuesdayMuesliSandwichesTomato soup
WednesdayMuesliLamb's lettucePotato soup
ThursdayBread rollsColeslawChicken soup
Friday2 rollsTomato saladFish soup
and after applying
this will result in
MondayLunchColorful garden salad
MondayDinnerNoodle soup
TuesdayDinnerTomato soup
WednesdayLunchLamb's lettuce
WednesdayDinnerPotato soup
ThursdayBreakfastBread roll
ThursdayDinnerChicken soup
FridayBreakfast2 rolls
FridayLunchtomato salad
FridayDinnerfish soup
Here, for the sake of completeness and better readibility, one should also rename the titles.
By using the following commands: +rename[COLUMN_TITLE]=Daytime +rename[COLUMN_VALUE]=Meal meaningful column headings will be added.

Special modes

There are some specialties when using %slice together with %merge.
In this case, for each merged file there will be added one column[field name] (field value, %slicecompact) or even two columns (field name and value, %slicedistinct) to each data row.
=> Eigene Seiten mit Beispielen!

%slicedistinct[Offset] starting past [Offset] splits all columns into own rows
(%slice is the same as %slice[1] is the same as %slicedistinct[1])
 with %merge: for each mergefile, starting from offset, for each mergefile add two columns, with field name and field value
 with two mergefiles: must specify a start fixed offset in each merged file: @slicedistinct[Offset]=[3],[3]
This is made for adding arbitrary columns from the merged file(s).

%slicecompact[field name] starting past [field name] splits all columns into own rows
(when used without %merge, this is identical to %slice[Field name] resp. %slicedistinct[Field name])
 with %merge: for each merged file, add one column [field name] with the field value of [field name]
 with two mergefiles: no fixed offsets necessary, because offset of [field name] is picked out each time
This is made for combining columns from the merged file(s) with the same name.
Under construction, coming soon