±prepend
Prepends some content to an existing CSV data field (column)
Prepends a value before the beginning of the data field.
The value can be a literal, the contents of another field, or any expression.
For inserting or prepending a whole new field to the data row, use ±add.
Pattern
±prepend[FieldName]=AdditionalValue
±prepend[FieldName],[FieldName]...=AdditionalValue
Usage
- -prepend[FieldName]=Today:\s
- Prepends "Today: " before the contents of the column
FieldName .
The \s stands for a whitepace character.
- -prepend[NetPrice],[GrossPrice]=USD
- Prepends the value " USD" to both fields
NetPrice andGrossPrice .
- -prepend[NetPrice],[GrossPrice]=[Currency]\s
- Prepends the content of the field
Currency and then a whitespace to both fieldsNetPrice andGrossPrice .
Example
[
If there is a csv file:
Product | Product Weight |
---|---|
Apple | 100g |
Pear | 120g |
- -Prepend["Transport Weight"]={(1,05*["Product Weight"]),3}g
- Prepends a new column
Transport Weight to the line and fills it with the value of the fieldProduct Weight * 1.05. The output shall be with decimal comma and 3 decimal places.
The quotes are necessary because of the whitespace in the column name.
Product | Product Weight | Transport Weight |
---|---|---|
Apple | 100g | 105,000g |
Pear | 120g | 126,000g |