Prevent one or more CSV columns from output
This command ignores columns from reading (when input) or hides them from output (when writing).
The most simple case is hiding just one unwanted field.
But you can also enter a list of fields to hide. In this case, it will is a comma-separated list of CSV column names (or numbers), and can even include column ranges denoted with a hyphen.
±hide[Fieldname] ±hide=[Fieldname] ±hide[AField],[AnotherField],... ±hide=[AField],[FirstOfMoreFields]-[LastOfMoreFields],...
Usage examplesThis is the input file names.csv.
- csvfox names.csv -hide[FirstName] lastnames.csv
This hides the column
FirstName. The resulting CSV table is written to lastnames.csv. lastnames.csv City LastName Birth Driver License Rome Bocelli 1958 y Los Angeles Columbo 1927 y London Poirot 1910 - New York Kojak 1922 y
- csvfox names.csv -hide, firstnames.csv
- This command hides the third and fourth column (
LastNameand Birth) of names.csv from output. firstnames.csv City FirstName Driver License Rome Andrea y Los Angeles Lieutnant y London Hercule - New York Theodoros y
- csvfox names.csv -hide[FirstName]-[Birth] nonames.csv
- This command hides a range of three columns (
FirstName, LastName, and Birth) of names.csv from output. nonames.csv City Driver License Rome y Los Angeles y London - New York y
This command is meant for preventing output of one or a few CSV columns.
If you want to rearrange column output completely, or just write only a few of many columns, consider using ±columns instead.