[colug-432] Nice Plain Text Columns and Avoiding NIH

Jon Miller jonebird at gmail.com
Mon Aug 8 09:05:37 EDT 2011


It's not fancy but it probably falls into the "classic" category: expand
It is a part of the coreutils package and there are potentially other
answers from that package.

'expand' will replace tabs with spaces, however it requires you to
like the output from the tabs in the first place. That is, how it
looks printed on your terminal will look the same once it's been
processed with 'expand' and will not attempt to align the entire
column(s) of data.

-- Jon Miller

On Mon, Aug 8, 2011 at 8:47 AM,  <jep200404 at columbus.rr.com> wrote:
> Let's start over.
>
> On Sun, 7 Aug 2011 22:16:18 -0400, Jeff Frontz <jeff.frontz at gmail.com> wrote:
>
>> Maybe I'm misunderstanding what it is that you want, ...
>
> You are not the only one to misunderstand what I want.
>
> First of all, I am _not_ asking how to make a program,
> or about techniques for making a program.
> For decades, I have known many ways to make such a program.
> I was trying to avoid writing such a program altogether.
> Instead I was wanting to know of an already existing program
> that someone else had written.
>
> Here's what I am looking for.
>
> A _pre-existing_ program that:
>    o   is a classic plain text filter
>    o   uses tabs to delimit input fields (columns)
>    o   echoes the input, replacing tabs with enough spaces so
>        as to make the fields line up in nice columns
>        o   each column would only get as much space as it
>            needs to line up nice
>            (program would have to read all input to figure
>            output width of each field, before outputting
>            anything)
>        o   output columns would be separated with a single ' '
>
> or more fancily:
>
> A _pre-existing_ program that:
>    o   is a classic plain text filter
>    o   uses tabs to delimit input fields (columns)
>        (option to specify arbitrary delimiter would be nice)
>    o   echoes the input, replacing tabs with spaces so
>        as to make the fields line up in nice columns
>        o   each column would only get as much space as it
>            needs to line up nice
>            (program would have to read all input to figure
>            output width of each field, before outputting
>            anything)
>            (would be nice to have option to limit width of
>            particular output columns)
>            (would be nice to have option to specify minimum
>            width for particular output columns)
>        o   output columns would be separated with a single ' '
>            (option to specify other separator would be nice)
>
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>



More information about the colug-432 mailing list