recset
Update field values in GNU recutils databases
TLDR
Update field value
SYNOPSIS
recset [options] [file]
DESCRIPTION
recset modifies field values in GNU recutils plain-text database files, updating existing fields or adding new ones based on selection expressions. It uses the same expression syntax as recsel to target specific records, then sets the specified field to a new value.
The -a flag adds the field only to records where it does not already exist, and -n limits updates to the first N matching records. Without a selection expression, all records in the file are updated. The file is modified in place. Part of the GNU recutils toolkit.
PARAMETERS
-t, --type type
Record type.-f, --field name
Field to set.-v, --value value
New value.-e, --expression expr
Selection expression.-a, --add
Add field if missing.-n, --num n
Update first n matches.
EXAMPLES
recset -f Status -v "completed" -e "Status = 'pending'" tasks.rec
# Update all records
recset -f Updated -v "$(date)" data.rec
# Update specific type
recset -t Contact -f Phone -v "555-0000" -e "Name = 'John'" contacts.rec
# Add field if not exists
recset -a -f Category -v "General" -e "!Category" items.rec
# Update first match
recset -n 1 -f Priority -v "high" -e "Status = 'new'" tasks.rec
CAVEATS
Modifies file in place. Use selection expressions carefully. Part of GNU recutils.
HISTORY
recset is part of GNU recutils by Jose E. Marchesi for managing text databases.
