help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A robust but concise way to read TSV header?


From: Peng Yu
Subject: Re: A robust but concise way to read TSV header?
Date: Thu, 24 Jun 2021 09:44:27 -0500

CSV is not an option. I just need to pass TSV files.

BTW, how robust is this csv builtin. CSV is a far more complex format
than TSV given that CSV involves quoting. It seems that it is not very
easy to make a CSV builtin correctly given that there are so many
flavors of CSV formats.

On 6/24/21, Jesse Hathaway <jesse@mbuki-mvuki.org> wrote:
> On Thu, Jun 24, 2021 at 9:17 AM Peng Yu <pengyu.ut@gmail.com> wrote:
>> The following won't work, as it removes empty fields.
>
> Would using a CSV be an option rather than a TSV? If so you could use the
> csv builtin:
>
> $ enable -f /usr/lib/bash/csv csv
> $ csv -a foo 'a,,b'
> $ declare -p foo
> declare -a foo=([0]="a" [1]="" [2]="b")
>


-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]