filters.go
func Columns(columns ...int) Filter {
	return FilterFunc(func(arg Arg) error {
		for _, c := range columns {
			if c <= 0 {
				return fmt.Errorf("stream.Columns: invalid column number %d", c)
			}
		}
		for s := range arg.In {
			result := ""
			for _, col := range columns {
				if _, c := column(s, col); c != "" {
					if result != "" {
						result = result + " "
					}
					result = result + c
				}
			}
			arg.Out <- result
		}
		return nil
	})
}
func Columns(columns ...int) Filter {
	return FilterFunc(func(arg Arg) error {
		for _, c := range columns {
			if c <= 0 {
				return fmt.Errorf("stream.Columns: invalid column number %d", c)
			}
		}
		for s := range arg.In {
			result := ""
			for _, col := range columns {
				if _, c := column(s, col); c != "" {
					if result != "" {
						result = result + " "
					}
					result = result + c
				}
			}
			arg.Out <- result
		}
		return nil
	})
}
func Columns ( columns ... int ) Filter { return FilterFunc ( func ( arg Arg ) error { for _ , c := range columns { if c <= 0 { return fmt . Errorf ( " " , c ) } } for s := range arg . In { result := " " for _ , col := range columns { if _ , c := column ( s , col ) ; c != " " { if result != " " { result = result + " " } result = result + c } } arg . Out <- result } return nil } ) }
// Columns splits each item into columns and yields the concatenation
// (separated by spaces) of the columns numbers passed as arguments.
// Columns are numbered starting at 1.  If a column number is bigger
// than the number of columns in an item, it is skipped.
Columns splits each item into columns and yields the concatenation ( separated by spaces ) of the columns numbers passed as arguments . Columns are numbered starting at 1 . If a column number is bigger than the number of columns in an item it is skipped .