recfiles is a
file format
A file format is a Computer standard, standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary format, pr ...
for human-editable,
plain text
In computing, plain text is a loose term for data (e.g. file contents) that represent only characters of readable material but not its graphical representation nor other objects ( floating-point numbers, images, etc.). It may also include a lim ...
database
In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and a ...
s.
Databases using this file format can be edited using any
text editor
A text editor is a type of computer program that edits plain text. An example of such program is "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be used to c ...
. Recfiles allow for basic
relational database
A relational database (RDB) is a database based on the relational model of data, as proposed by E. F. Codd in 1970.
A Relational Database Management System (RDBMS) is a type of database management system that stores data in a structured for ...
operations, such as typing, auto-incrementing, as well as a simple
join operation.
Recutils is a collection of tools, like ''recfmt'', ''recsel'', and ''rec2csv'' used to work with recfile databases.
Various software libraries support the format.
Syntax
Data are stored in text files with empty lines separating records. Fields within a record are lines starting with their name and a colon; it is possible to wrap long entries. Multiple record types can be maintained in a single text file.
Example
# This is a recfile document.
%rec: Text
%type: Year int
Author: Doug McIlroy
Year: 1964
Note: The Origin of Unix Pipes
Title: Unix Text Processing
Author: Dale Dougherty
Author: Tim O'Reilly
Year: 1987
Publisher: Hayden Books
Author: William Shakespeare
Title: Hamlet
Year: 1599
Year: 1600
Year: 1601
Utilities
Recutils from the
GNU Project
The GNU Project ( ) is a free software, mass collaboration project announced by Richard Stallman on September 27, 1983. Its goal is to give computer users freedom and control in their use of their computers and Computer hardware, computing dev ...
are a set of free command line utilities to process recfiles.
These include:
* recsel – search for and print fields from records matching a query
* recins – insert a record, or replace existing records
* recdel – delete a record, or delete a set of records
* recfix – sort the records
* recset – add or update individual fields
This example command would output the following three lines (of the two original entries, one having two authors):
$ recsel -e 'Year > "1900"' -p Author
Author: Doug McIlroy
Author: Dale Dougherty
Author: Tim O'Reilly
See also
*
asciidoc
AsciiDoc is a human-readable document format, semantically equivalent to DocBook XML, but using plain text mark-up conventions. AsciiDoc documents can be created using any text editor and read “as-is”, or rendered to HTML or any other fo ...
*
TOML
*
org-mode
Mode (also: ''org-mode''; ) is a mode for document editing, formatting, and organizing within the free software text editor GNU Emacs and its derivatives, designed for notes, planning, and authoring. The name is used to encompass plain text fi ...
*
Flat-file database
A flat-file database is a database stored in a file called a flat file. Records follow a uniform format, and there are no structures for indexing or recognizing relationships between records. The file is simple. A flat file can be a plain t ...
References
External links
*
Computer file formats
Computer-related introductions in 2010
Data serialization formats
GNU Project software
Lightweight markup languages
Open formats
Free software programmed in C
Software using the GNU General Public License
{{Free-software-stub