CSVfox
Leverage Your Data.
 English

±columns

Rearrange CSV columns for output

Description

This command rearranges columns from reading (when input) or for output (when writing).
It defines which columns in which order shall be returned.
You can specify a comma-separated list of fields for output.
And you can specify column ranges denoted with a hyphen.

Pattern

±columns=[Field],[NextField],[OneMoreField] ...
±columns=[Field],[FieldFrom]-[FieldTo],...

Usage examples

This is the input file names.csv.
names.csv
CityFirstNameLastNameBirthDriver License
RomeAndreaBocelli1958y
Los AngelesLieutnantColumbo1927y
LondonHerculePoirot1910-
New YorkTheodorosKojak1922y
csvfox names.csv -columns=[City],[LastName],[Birth],[Driver License] nofirstnames.csv
This denotes all columns in the original order, but omits the column FirstName. The resulting CSV table is written to nofirstnames.csv.
nofirstnames.csv
CityLastNameBirthDriver License
RomeBocelli1958y
Los AngelesColumbo1927y
LondonPoirot1910-
New YorkKojak1922y
csvfox names.csv -columns=[Driver License],[Birth],[LastName],[City] reverse_nofirstnames.csv
This reverses all columns order, and again omits the column FirstName. The resulting CSV table is written to reverse_nofirstnames.csv.
reverse_nofirstnames.csv
Driver LicenseBirthLastNameCity
y1958BocelliRome
y1927ColumboLos Angeles
-1910PoirotLondon
y1922KojakNew York
csvfox names.csv -columns=[City]-[LastName] city_names.csv
This command defines a range of three columns ( City, FirstName, and LastName) and the filename city_names.csv for output.
city_names.csv
CityFirstNameLastName
RomeAndreaBocelli
Los AngelesLieutnantColumbo
LondonHerculePoirot
New YorkTheodorosKojak

Hint

This command is meant for rearranging column output completely, or for writing only a few of many columns.
If you just want to prevent output of one or two CSV columns, consider using ±hide instead.

Under construction, coming soon