recins can also be used to replace existing records in a
database with a provided record. This is done by specifying some
criteria selecting the record (or records) to be replaced.
Consider for example the following command applied to our contacts database:
$ recins -e "Email = 'firstname.lastname@example.org'" -f Name -v "Mr. Foo" \ -f Email -v "email@example.com" contacts.rec
The contact featuring an email
firstname.lastname@example.org gets replaced with
the following record:
Name: Mr. Foo Email: email@example.com
The records to be replaced can also be specified by index, or a range of indexes. For example, the following command replaces the first, second and third records in a database with dummy records:
$ recins -n 0,1-2 -f Dummy -v XXX foo.rec $ cat foo.rec Dummy: XXX Dummy: XXX Dummy: XXX ... Other records ...