toys

Tools and things that make my life easier - y'all might like them too

View the Project on GitHub pfuntner/toys

columns

Purpose

I love this script so much! I must use this at least an average of once a day! The basic idea is that you tell it the positional columns you want to print and it prints them out.

Syntax

columns [-h] [-s DELIM | -r REGEXP | -c] [-n] [-f FILENAME] [-v] column [column ...]

Options and arguments

OptionDescriptionDefault
-s DELIM or -F DELIM or --separator DELIM or --delim DELIMSpecifies the regular expression to separate columns.The default is to separate columns by one or more whitespace characters
-r REGEXP or --regexp REGEXPSpecifies a regular expression by which to break up tokensThe default is to separate columns by one or more whitespace characters
-c or --csvReads input as CSVThe default is to separate columns by one or more whitespace characters
-n or --negateExcludes specified columnsIncludes specified columns
-f FILENAME or --filename FILENAMEReads input from the specified fileThe default is to read from stdin
-v or --verboseEnables debugging messagesDebugging messages are not printed

You can can specify columns in a few ways: