Column produces column col of each line of input, where the first column is column 1, and columns are delimited by Unicode whitespace. Lines containing fewer than col columns will be skipped.
(col int)
| 238 | // column 1, and columns are delimited by Unicode whitespace. Lines containing |
| 239 | // fewer than col columns will be skipped. |
| 240 | func (p *Pipe) Column(col int) *Pipe { |
| 241 | return p.FilterScan(func(line string, w io.Writer) { |
| 242 | columns := strings.Fields(line) |
| 243 | if col > 0 && col <= len(columns) { |
| 244 | fmt.Fprintln(w, columns[col-1]) |
| 245 | } |
| 246 | }) |
| 247 | } |
| 248 | |
| 249 | // Concat reads paths from the pipe, one per line, and produces the contents of |
| 250 | // all the corresponding files in sequence. If there are any errors (for |