Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: the splits





On 2024-05-21 22:56, Roman Perepelitsa wrote:
One little thing, can I have the first and last columns, but with a
tab between, or some other columnizer?
Tab instead of space:

  awk '{print $1 "\t" $NF}'

Left-justified first column:

  awk '{printf "%-16s\t%s\n", $1, $NF}'

Columnized output:

  awk '{print $1, $NF}' | column -t

`column -t` is easy to use and produces nicely aligned output. The
downside is that it buffers all input, so it's not always applicable.

Roman.
Gotta learn awk!  Nuts, made the wrong choice going with sed.


    



Messages sorted by: Reverse Date, Date, Thread, Author