From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 996A721737 for ; Wed, 22 May 2024 21:26:38 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1716405998; b=Dx2MPIQnu5u8DLWWXAvT+79hxImlLn6ntUxeOriti5lFL++jVNC5q282GtOF6gw519e/4+kp/1 XiG4heRXx4QzfxNJxJmdpsBjVuYUTJb2SS2Gv7nq4aax32boPDLIZEhAGQG0edOWzFxguFN4+5 3WkDyJ+twVh+qdgBbBOMDBupqE9QQ4gGsF3QZBmVj/gyyFXLOzT6ULt7AotYSodO9sygcC3lLN HRT3o5OB6A68qy5NZ7hAqOgsAM+ADqb8vLUlK6mpGhk+1G7xAQ1GLrdRR3hZBhgrCmOHT5SoJH ix2neQf1AMy1Yt3TwU3Th67CX3QW326dl4OFdD6A6F2zjA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1716405998; bh=itX1BewRexqalG77WVFWjaW+yNR6mIDaL2LGmWNabWg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=KdTe9G1Mzo6RsG0DNJGNceBjMe+WT3v4z/HCF0rx82r3VDHIDWeAufQOtAzDBrxfEnbaiY8OxV IhytlIjJyHBIKmnGRYmSkmIeiqEo2U9Lpr64+henszB2dW6m6zilaN2VSHnHudC2P3J9jQJIFd TmSBZhnOcpVNel9m+WALDb3otZCLcnvB1Tb0XX37ITRSyg6gbs0l+YVP3hjAUoDzf5sy93oTUo HkkkU7+YZt1vAtn9C1bUVdUw3dLM2e28Jcz3dSkGsnZMwEzKRhIy+2yRKaN3MM/8g9Bk+lT3K7 9LZxuSH9nmxI7HQ9NObaxHkUOEBlwanHmMYIQ2ek41ERjA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-reply-to:From:References:To: Subject:MIME-version:Date:Message-id:Content-type:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=phsRR510R0pRW4mDcxLOKiw6xg0sFgTEFQScUqFzIJo=; b=FBEzQvVxTF4PyHSkvb9Q1RQY2I tTRkX2SLT96frorh1HvCfoMc8VLpTMivovpjAOf0WBRn+ZaKN3mKsBdAqFpTafZh6CrPWXbSXSotK nign2Iil4Mc6nhrX7TyM79UOgzMGWrp+JtW2y8bd4sL9K7Ahk90cTZ1bTLixoojtUa8yR3WAGtyyQ y7v7GSFD7ZKmqW+IxpFmKKH4I2HKhxVT6xv4UFjk2+WAgFE7pTNQ0S5pCE4WuSRoAZdXbkonU1sas dFW54LUlO/Hyy0sbDvwzlaAL4br4AniPYWZZILu5PFzlO1STERUzJGw3IPB8IXRGXnMRL0cQMifnU s9CBC+jA==; Received: by zero.zsh.org with local id 1s9rbh-000GGP-3W; Wed, 22 May 2024 19:26:37 +0000 Authentication-Results: zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none Received: from mta03.eastlink.ca ([24.224.136.9]:56317) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s9raw-000FZX-VS; Wed, 22 May 2024 19:25:52 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta03.eastlink.ca ([24.224.136.9]) with ESMTPS id <0SDW22D0TJ3ZNM01@mta03.eastlink.ca> for zsh-users@zsh.org; Wed, 22 May 2024 16:25:25 -0300 (ADT) Received: from [192.168.0.15] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp02.eastlink.ca ([71.7.199.167]) with ESMTPSA id 9raWsKu2OxAjx9raWs9oFa (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Wed, 22 May 2024 16:25:24 -0300 X-Authority-Analysis: v=2.4 cv=EfprQ+mC c=1 sm=1 tr=0 ts=664e46a4 a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=guL6kOSSldcwri4_ytIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=nv-id5sLha0lKY8R2BIA:9 a=YPlLnuH2ksMK5M8s:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeigedgheeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduhegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------04vlC0kU0HHM1aUE08cvaPcs" Message-id: Date: Wed, 22 May 2024 12:25:25 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: the splits To: zsh-users@zsh.org References: <75784205-3d78-4dd8-8474-e2eb48598307@eastlink.ca> <0b6a048b-4fbf-4162-a31a-d5f6f963d72a@eastlink.ca> Content-language: en-US From: Ray Andrews In-reply-to: X-Seq: 29967 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: This is a multi-part message in MIME format. --------------04vlC0kU0HHM1aUE08cvaPcs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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. --------------04vlC0kU0HHM1aUE08cvaPcs Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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.


    

--------------04vlC0kU0HHM1aUE08cvaPcs--