Skip to main content
U.S. FlagAn official website of the United States government
icon dot gov
Official websites use .gov

A .gov website belongs to an official government organization in the United States.

icon https
Secure .gov websites use HTTPS

A lock () or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

colreorder

colreorder allows for basic reorder of CSV data from the symbolic names in the first line of the data. The first line is parsed as a header then those names used to specify the output order of the columns. The new header is also output. By default columns not specified to be reordered but that are present in the input are added to the end of the reorder columns.

Command Line Usage

colreorder [--discard-unspecified] Col1,Col2...

Arguments

--discard-unspecified

If set then columns not present in the header specification but present in the input will be discarded instead of added to the end.

Col1,Col2...

The list of columns to output in order. This may also consist of multiple arguments (effectively separated by spaces instead of commas).

Example Usage

data.get bnd S11a 2012-10-01 1h | data.export | colreorder --discard-unspecified Year,DOY,F1_S11,BsG_S11