bug-recutils
[Top][All Lists]
Advanced

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

Re: [bug-recutils] use of recsel when records contain multiple instances


From: Charles Millar
Subject: Re: [bug-recutils] use of recsel when records contain multiple instances of same field-name in each record (was use of)
Date: Wed, 19 Apr 2017 09:46:56 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Thank you, Eric.

The following does give me the output I desire

recsel -e 'Tag = "This"' Contacts.rec | recsel -e 'Tag = "That"' -p Name

However, why? Please note that the last recsel does not have a recfile as the final argument.

BTW, I did try your idea with one of my "real world" recfiles using different combinations and each time the output was as expected.

Still, a one recsel SEX would be nice.

Charlie

On 04/18/17 21:38, Eric Nystrom wrote:
This doesn't directly address the sexexp question, but you could do recsel with the first selection, then pipe that into recsel again to select with the second _expression_.

Best regards,

-Eric


On Apr 18, 2017 5:31 PM, "Charles Millar" <address@hidden> wrote:
I am attempted to construct a recsel SEX for the following Contacts.rec fileĀ  that will result with Person 1 and Person 3

Name; Person 1
Tag: This
Tag: That
Tag: These

Name: Person 2
Tag: These
Tag: This

Name: Person 3
Tag: That
Tag: These
Tag: This

Name: Person 4
Tag: This
Tag: Those
tag: These

Name: Person 5
Tag: That

One of my attempts

recsel -e \( 'Tag ~ "This"' && 'Tag ~ "That"' \) -P Name Contacts.rec

returns the command prompt only (no error message)

Please note that "Tag" is the field name (label) and that the field values for "Tag" may entered randomly, and sometimes later when the rec file is updated and that each contact may have any number of "Tags". Therefore I do not believe that using subscripts such as Tag[1] would be useful.

Also, the "recsel -e 'Tag ~ "This"' -P Name Contacts.rec" does return a lsit of Persons 1 - 4

I have very little (i.e. nil) regex knowledge, so any help would be appreciated.

If this rescel is not possible, could this be considered as a future enhancement to Recutils?

Charlie Millar




reply via email to

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