help-recutils
[Top][All Lists]
Advanced

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

Re: [help-recutils] How to do some selection


From: Jose E. Marchesi
Subject: Re: [help-recutils] How to do some selection
Date: Thu, 10 Feb 2011 18:34:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

Hi Fabrice.

(Sorry for the possible delay, but the GNU mailing lists are having some
problems with the delivery of the mail)
    
    First of all, "bravo" for this tool , i like it.
    I would like to do some selections:
    
    I have one recfile RTL.rec with fields
    
    Date, Auteur, Titre, Section
    
    How could i select records with field Section not equal to null ?

If with "not equal to null" you mean records having some field with
that name then you can use the # operator:

recsel -e "#Section" RTL.rec

#FNAME returns the number of fields named FNAME in the record, and the
returned value is interpreted as a boolean.

    How could i select records with field Auteur contains a string ?  as
    an example i would like to have all record where field Auteur
    contains string "cold"

Easy.  If you are searching for an exact match you can use the =
operator, like in:

recsel -e "Auteur = 'Cold'" RTL.rec

Otherwise you can use the regexp match operator:

recsel -e "Auteur ~ 'Cold'" RTL.rec

    How could i count number of record with field Auteur equal to "U2" ?

Use the -c option to recsel to get a count:

recsel -e "Auteur = 'U2'" -c RTL.rec

Hope this helps! :)

-- 
Jose E. Marchesi    address@hidden
GNU Project         http://www.gnu.org



reply via email to

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