CSVfox
Leverage Your Data.

±rename

Rename a field (a column) or several columns in the CSV file to be output

Description

This command renames one or more existing columns of an input or output file.
If it is applied to an input file, the new name of the column(s) must be used in the subsequent commands and also in the output file.
If you want to rename more than one column at the same time, you can provide a comma-separated list or a consecutive range of columns that shall be renamed. In this case, make sure that you provide exactly the number of new names that are required.

Pattern

±rename[Field]=["New Name"] ±rename[Field1]-[FieldN]=[NewName1],...,[NewNameN] ±rename[Field1],...,[FieldN]=[NewName1],...,[NewNameN]

Usage examples

-rename[3]=["New Name"]
renames the third column to "New Name".
-rename[C]=["New Name"]
renames the third column to "New Name" (Excel Notation).
-rename["Value added tax"]=["Sales tax"]
renames the column "Value added tax" to "Sales tax", regardless of its position.
The quotation marks are necessary because spaces occur in the column names.
+rename[4]-[6]=[Fourth],[Fifth],[Sixth]
renames the fourth to sixth column of the output file.
+rename[D]-[F]=[Fourth],[Fifth],[Sixth]
renames the fourth to sixth column of the output file (Excel Notation).
+rename[D]-[F]=Fourth,Fifth,Sixth
renames the fourth to sixth column of the output file (Excel Notation).
You can use this more compact notation without brackets only if no commas or other special characters appear in the column name!
-rename["Value added tax"],[Today]=["Sales tax"],[Tomorrow]
renames the column "Value added tax" to "Sales tax" and the column "Today" to "Tomorrow".
-rename[2018-Q1]-[2018-Q4]="[Winter 2018],[Spring 2018],[Summer 2018],[Autumn 2018]"
renames the columns "2018-Q1" to "2018-Q4" (there must be exactly four consecutive columns) to "Winter 2018", "Spring 2018", "Summer 2018" and "Autumn 2018".
The quotation marks are necessary because spaces occur in the new column names.
Under construction, coming soon