Last active
March 25, 2025 18:13
Revisions
-
gmolveau revised this gist
Jan 28, 2020 . No changes.There are no files selected for viewing
-
gmolveau revised this gist
Jan 27, 2020 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,11 @@ https://www.gnu.org/software/recutils/ > GNU Recutils is a set of tools and libraries to access human-editable, plain text databases called recfiles. TO install on mac : `brew install recutils` > add this to a new file named `books.rec` ```bash %rec: Book -
gmolveau revised this gist
Jan 27, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,7 +50,7 @@ recsel -t Book -e "Location = 'loaned'" -P Title books.rec ```bash #recins -t TYPE (%rec) -f FIELD (Title) -v VALUE file.rec recins -t Book -f Title -v "TheNewBook" -f Author -v "OuiLaVoix" -f Author -v "LaPetiteVoix" books.rec ``` - update -
gmolveau renamed this gist
Jan 27, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
gmolveau created this gist
Jan 27, 2020 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,71 @@ # recutils tutorial example https://www.gnu.org/software/recutils/ On mac : `brew install recutils` > add this to a new file `books.rec` ```bash %rec: Book #%key: Id #%type: Id int #%auto: Id #%unique: ISBN %mandatory: Title %type: Location enum loaned home unknown %doc: + A book in my personal collection. Title: GNU Emacs Manual Author: Richard M. Stallman Publisher: FSF Location: home Title: The Colour of Magic Author: Terry Pratchett Location: loaned Title: Mio Cid Author: Anonymous Location: home Title: chapters.gnu.org administration guide Author: Nacho Gonzalez Author: Jose E. Marchesi Location: unknown Title: Yeelong User Manual Location: home ``` - select ```bash # recsel -t TYPE (%rec) -e EXPRESSION -P PRINT_ONLY_THESE_FIELDS file.rec recsel -t Book -e "Location = 'loaned'" -P Title books.rec ``` - insert ```bash #recins -t TYPE (%rec) -f FIELD (Title) -v VALUE file.rec recins -t Book -f Title -v "TheNewBook" books.rec ``` - update ```bash # recset -t TYPE (%rec) -f FIELD -d (DELETE_THIS_FIELD) file.rec recset -t Book -f Publisher -d books.rec # recset -t TYPE (%rec) -e EXPRESSSION -f FIELD -S CREATE_FIELD_WITH_VALUE_OR_REPLACE file.rec recset -t Book -e "Location = 'loaned'" -f LoanedAt -S "$(date)" books.rec ``` - delete ```bash # recdel -c (COMMENT INSTEAD OF DELETE) -t TYPE (%rec) -e EXPRESSION file.rec recdel -c -t Book -e "Location = 'loaned'" books.rec ```