CSVfox
Leverage Your Data.
 English

±insert

Inserts a field (a column) to the CSV data row before a specific position.

Description

Inserts a new column before an existing column of the data row, and optionally fills it with a value.
The value can be a literal, the contents of another field, or any expression.
If you want to append a column at the end of the data row instead, then you can use ±add.

Pattern

±insert[NewFieldName]@[ExistingFieldname] ±insert[NewFieldName]@[ExistingFieldname]=NewFieldValue

Usage Examples

If there is a csv file:

ProductProduct WeightTransport Weight
Apple100g105,000g
Pear120g126,000g
Banana200g210,000g

-insert["Product ID"]@["Product Weight"]
Inserts a new empty column "Product ID" before the column "Product Weight". A subsequent field command can later be used to fill it with a value.
The resulting csv file will be:
ProductProduct IDProduct WeightTransport Weight
Apple100g105,000g
Pear120g126,000g
Banana200g210,000g

More examples

-insert["Line Number"]@[1]=(#)
Inserts a new first column "Line Number" before the recent first column, and initializes it with the current data row number.
Under construction, coming soon