On Mon, Jan 14, 2013 at 5:04 AM, Pádraig Brady <[email protected]> wrote:

> On 09/18/2012 03:18 PM, CoreUtils subscribtion for PLC wrote:
>
>> Hi
>>
>> This post is about a possible enhancement to the "expand" command
>> included in coreutils.
>>
>> I oten use expand to format scripts output by manually setting tabs stop.
>> The idea would be to add an option to "expand" to be able to auto-set
>> tabstops by analyzing first <n> lines of test (0 for analyzing whole
>> stream) so that the TS would be set to the minimum number of spaces to
>> obtains clean columns.
>>
>> Best regards
>>
>> plc
>>
>
> So for input with just leading tabs, they would be expanded to a single
> space,
> but in the presence of both leading tabs and spaces, the tab width would
> be set to the minimum such that non blanks only start at a tab stop.
>
> Interesting idea, though not very useful I would expect,
> since you'd probably have to specify a minimum with the --tabs option,
> at which stage you don't have much advantage over just setting --tabs
> directly.
>
> thanks,
> Pádraig.
>
>
This feature is already provided by a separate utility named column,
dedicated to columnization, which is available under BSD license.

What is not provided there is ability to analyze only first <n> lines.

So unless it is about licensing, it may be better to enhance column instead
of expand. If licensing is an issue then it may be better to add a utility
dedicated to columnization to Coreutils, instead of enhancing expand.

Thanks,
Anoop

Reply via email to