help-recutils
[Top][All Lists]
Advanced

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

Re: [help-recutils] Easier way to get a list of fields for a record?


From: Aikido Guy
Subject: Re: [help-recutils] Easier way to get a list of fields for a record?
Date: Fri, 4 Oct 2013 10:10:36 -0400

On Thu, Oct 3, 2013 at 2:31 PM, Jose E. Marchesi <address@hidden> wrote:

    I was hoping for a more direct way, perhaps using recinfo, to get a
    list of fields.

That would be an interesting addition to recinf.  But what would be the
more convenient way to obtain metainformation about a recfile?  We could
use rec data:

$ recinf --fields foo.rec
Field: fieldname1
Field: fieldname2
...

More ideas?

Currently recinf can do:
$  recinf --type=one tmp.rec
1 one
$ recinf --type=one --names-only tmp.rec
one

So I'd like:
$  recinf --type=one --fields tmp.rec
1 fieldnameA
2 fieldnameB
1 fieldnameC

The number associated with a field can indicate how many times this field is used in records of the particular type (--type=one), or if no type supplied, then the count could be for all record types in the rec file.

$ recinf --type=one --fields --names-only tmp.rec
fieldnameA
fieldnameB
fieldnameC

And the above command does not produce the numbers, only the field names, one per line.

reply via email to

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